Skip to content

Commit 4a44143

Browse files
committed
docs(button): add danger and warning use cases
1 parent bedbfc9 commit 4a44143

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

packages/site-demo/content/product/components/button/index.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ Use full width when you need to get the button full width.
4040

4141
<DemoBlock vAlign="center" demo="full-width" withThemeSwitcher />
4242

43+
## Warning
44+
45+
Use `Warning` buttons to confirm actions that may cause a significant change.
46+
Low emphasis is currently not supported.
47+
48+
<DemoBlock vAlign="center" demo="warning" withThemeSwitcher />
49+
50+
## Danger
51+
52+
Use `Danger` buttons to confirm a destructive and irreversible action, such as deleting.
53+
54+
<DemoBlock vAlign="center" demo="danger" withThemeSwitcher />
55+
4356
### Accessibility concerns
4457

4558
#### Button
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { mdiDelete } from '@lumx/icons';
2+
import { Button, Emphasis, FlexBox, IconButton, Orientation, Size } from '@lumx/react';
3+
import React from 'react';
4+
5+
export const App = ({ theme }: any) => (
6+
<>
7+
<FlexBox gap={Size.big} orientation={Orientation.horizontal} wrap>
8+
<Button color='red' theme={theme} >Delete</Button>
9+
<IconButton label="Delete" icon={mdiDelete} color='red' theme={theme} />
10+
</FlexBox>
11+
<FlexBox gap={Size.big} orientation={Orientation.horizontal} wrap>
12+
<Button emphasis={Emphasis.medium} color='red' theme={theme} >Delete</Button>
13+
<IconButton label="Delete" icon={mdiDelete} emphasis={Emphasis.medium} color='red' theme={theme} />
14+
</FlexBox>
15+
<FlexBox gap={Size.big} orientation={Orientation.horizontal} wrap>
16+
<Button emphasis={Emphasis.low} color='red' theme={theme} >Delete</Button>
17+
<IconButton label="Delete" icon={mdiDelete} emphasis={Emphasis.low} color='red' theme={theme} />
18+
</FlexBox>
19+
</>
20+
);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { mdiClose } from '@lumx/icons';
2+
import { Button, Emphasis, FlexBox, IconButton, Orientation, Size } from '@lumx/react';
3+
import React from 'react';
4+
5+
export const App = ({ theme }: any) => (
6+
<>
7+
<FlexBox gap={Size.big} orientation={Orientation.horizontal} wrap>
8+
<Button color='yellow' theme={theme} >Remove</Button>
9+
<IconButton label="Remove" icon={mdiClose} color='yellow' theme={theme} />
10+
</FlexBox>
11+
<FlexBox gap={Size.big} orientation={Orientation.horizontal} wrap>
12+
<Button emphasis={Emphasis.medium} color='yellow' theme={theme} >Remove</Button>
13+
<IconButton label="Remove" icon={mdiClose} emphasis={Emphasis.medium} color='yellow' theme={theme} />
14+
</FlexBox>
15+
</>
16+
);

0 commit comments

Comments
 (0)