Skip to content

Commit

Permalink
[@mantine/core] NavLink: Add collapse Styles API selector (#5776)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Feb 16, 2024
1 parent 61eb5f0 commit 39b53fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/@docs/styles-api/src/data/NavLink.styles-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const NavLinkStylesApi: StylesApiData<NavLinkFactory> = {
description: 'Dimmed description displayed below the label',
children: 'Wrapper around nested links',
chevron: 'Default chevron icon',
collapse: 'Nested links Collapse container',
},

vars: {
Expand Down
3 changes: 2 additions & 1 deletion packages/@mantine/core/src/components/NavLink/NavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export type NavLinkStylesNames =
| 'label'
| 'description'
| 'chevron'
| 'collapse'
| 'children';
export type NavLinkVariant = 'filled' | 'light' | 'subtle';
export type NavLinkCssVariables = {
Expand Down Expand Up @@ -223,7 +224,7 @@ export const NavLink = polymorphicFactory<NavLinkFactory>((_props, ref) => {
</Box>
)}
</UnstyledButton>
<Collapse in={_opened}>
<Collapse in={_opened} {...getStyles('collapse')}>
<div {...getStyles('children')}>{children}</div>
</Collapse>
</>
Expand Down

0 comments on commit 39b53fe

Please sign in to comment.