Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add links to mantine #117

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chatty-files-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"nhsuk-frontend-react": patch
---

docs(nhsuk-frontend-react): add links to mantine and their polymophic component docs
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ This implementation supports the latest version of the NHS.UK Frontend library a

## Polymorphic Components

A few components in this library are polymorphic, meaning they can accept a different component as a prop. This is particularly useful when you want to use a custom component, say a `Link` component from a routing library, instead of the default `a` tag.
A few components in this library are polymorphic, meaning they can accept a different component as a prop and render as that component. This is particularly useful when you want to use a custom component, say a `Link` component from a routing library, instead of the default `a` tag.

This feature is was taken from [Mantine](https://github.com/mantinedev/mantine), have a look at their [polymorphic components documentation](https://mantine.dev/guides/polymorphic/) for more information.

Here is an example of how you can use a custom `Link` component with the `Header.Logo` component:

Expand All @@ -43,7 +45,7 @@ export const AppHeader = () => (
);
```

### Full List of Polymorphic Components
## Full List of Polymorphic Components

<details>
<summary>Click to expand</summary>
Expand Down
6 changes: 4 additions & 2 deletions packages/nhsuk-frontend-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ This implementation supports the latest version of the NHS.UK Frontend library a

## Polymorphic Components

A few components in this library are polymorphic, meaning they can accept a different component as a prop. This is particularly useful when you want to use a custom component, say a `Link` component from a routing library, instead of the default `a` tag.
A few components in this library are polymorphic, meaning they can accept a different component as a prop and render as that component. This is particularly useful when you want to use a custom component, say a `Link` component from a routing library, instead of the default `a` tag.

This feature is was taken from [Mantine](https://github.com/mantinedev/mantine), have a look at their [polymorphic components documentation](https://mantine.dev/guides/polymorphic/) for more information.

Here is an example of how you can use a custom `Link` component with the `Header.Logo` component:

Expand All @@ -43,7 +45,7 @@ export const AppHeader = () => (
);
```

### Full List of Polymorphic Components
## Full List of Polymorphic Components

<details>
<summary>Click to expand</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const meta: Meta = {
'5',
'10',
'20',
'30',
'full',
'one-half',
'one-third',
Expand All @@ -47,6 +48,7 @@ export const Default: Story = {
export const WithFixedWidth: Story = {
render: (args) => (
<>
<Input {...args} label="30 character width" width="30" />
<Input {...args} label="20 character width" width="20" />
<Input {...args} label="10 character width" width="10" />
<Input {...args} label="5 character width" width="5" />
Expand Down