Skip to content

Commit

Permalink
docs: add button link demo (#4089)
Browse files Browse the repository at this point in the history
* docs: add button link demo

* change to priamry
  • Loading branch information
sebald authored Aug 6, 2024
1 parent 72f5e07 commit 5d4c753
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docs/content/components/form/button/button-link.demo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Button, Inline, Link } from '@marigold/components';

export default () => (
<Inline space={2} alignY="center" alignX="center">
<Button variant="primary">Save</Button>
<Link variant="secondary" href="#">
Cancel
</Link>
</Inline>
);
2 changes: 1 addition & 1 deletion docs/content/components/form/button/button-press.demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default () => {
return (
<Stack space={3} alignX="left">
<Button
variant="secondary"
variant="primary"
onPress={() => setCount(count + 1)}
onPressStart={e => setPointerType(e.pointerType)}
onPressEnd={() => setPointerType('')}
Expand Down
2 changes: 2 additions & 0 deletions docs/content/components/form/button/button.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ Understanding this distinction is crucial: anchors handle navigation, while butt

To visually imitate a button element that navigates (e.g., a "Cancel" action that redirects users to the previous page), use the [`<Link>`](/components/content/link) component with the corresponding `variant`, usually `secondary`. This way, the action is clear and prominent while keeping its navigation function.

<ComponentDemo file="./button-link.demo.tsx" />

<GuidelineTiles>
<Do>
<Do.Description>
Expand Down

0 comments on commit 5d4c753

Please sign in to comment.