-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[@mantine/core] ActionIcon: Add gradient variant support (#2133)
* [@mantine/core] ActionIcon: Add support for gradient variant. * [@mantine/core] ActionIcon: Add missing keys in storybook demo.
- Loading branch information
1 parent
02bdf0d
commit 72555ad
Showing
5 changed files
with
224 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/mantine-demos/src/demos/core/ActionIcon/ActionIcon.demo.gradient.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import React from 'react'; | ||
import { ActionIcon, Group } from '@mantine/core'; | ||
import { IconSun } from '@tabler/icons'; | ||
|
||
const code = ` | ||
import { ActionIcon, Group } from '@mantine/core'; | ||
import { Sun } from 'tabler-icons-react'; | ||
function Demo() { | ||
return ( | ||
<> | ||
<ActionIcon variant="gradient" gradient={{ from: 'indigo', to: 'cyan' }}><IconSun size={18} /></ActionIcon> | ||
<ActionIcon variant="gradient" gradient={{ from: 'teal', to: 'lime', deg: 105 }}><IconSun size={18} /></ActionIcon> | ||
<ActionIcon variant="gradient" gradient={{ from: 'teal', to: 'blue', deg: 60 }}><IconSun size={18} /></ActionIcon> | ||
<ActionIcon variant="gradient" gradient={{ from: 'orange', to: 'red' }}><IconSun size={18} /></ActionIcon> | ||
<ActionIcon variant="gradient" gradient={{ from: '#ed6ea0', to: '#ec8c69', deg: 35 }}><IconSun size={18} /></ActionIcon> | ||
</> | ||
); | ||
} | ||
`; | ||
|
||
function Demo() { | ||
return ( | ||
<Group position="center"> | ||
<ActionIcon variant="gradient" gradient={{ from: 'indigo', to: 'cyan' }}> | ||
<IconSun size={18} /> | ||
</ActionIcon> | ||
<ActionIcon variant="gradient" gradient={{ from: 'teal', to: 'lime', deg: 105 }}> | ||
<IconSun size={18} /> | ||
</ActionIcon> | ||
<ActionIcon variant="gradient" gradient={{ from: 'teal', to: 'blue', deg: 60 }}> | ||
<IconSun size={18} /> | ||
</ActionIcon> | ||
<ActionIcon variant="gradient" gradient={{ from: 'orange', to: 'red' }}> | ||
<IconSun size={18} /> | ||
</ActionIcon> | ||
<ActionIcon variant="gradient" gradient={{ from: '#ed6ea0', to: '#ec8c69', deg: 35 }}> | ||
<IconSun size={18} /> | ||
</ActionIcon> | ||
</Group> | ||
); | ||
} | ||
|
||
export const gradient: MantineDemo = { | ||
type: 'demo', | ||
component: Demo, | ||
code, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export { colors } from './ActionIcon.demo.colors'; | ||
export { configurator } from './ActionIcon.demo.configurator'; | ||
export { variants } from './ActionIcon.demo.variants'; | ||
export { gradient } from './ActionIcon.demo.gradient'; |