-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example of horizontal radios (#3009)
- Loading branch information
1 parent
1dc3e43
commit cb304d0
Showing
2 changed files
with
28 additions
and
2 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
25 changes: 25 additions & 0 deletions
25
aksel.nav.no/website/pages/eksempler/radio-horizontal/horizontal.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,25 @@ | ||
import { Radio, RadioGroup, Stack } from "@navikt/ds-react"; | ||
import { withDsExample } from "@/web/examples/withDsExample"; | ||
|
||
const Example = () => { | ||
return ( | ||
<RadioGroup legend="Har du barn?"> | ||
<Stack gap="0 6" direction={{ xs: "column", sm: "row" }} wrap={false}> | ||
<Radio value="1">Ja</Radio> | ||
<Radio value="0">Nei</Radio> | ||
</Stack> | ||
</RadioGroup> | ||
); | ||
}; | ||
|
||
// EXAMPLES DO NOT INCLUDE CONTENT BELOW THIS LINE | ||
export default withDsExample(Example); | ||
|
||
/* Storybook story */ | ||
export const Demo = { | ||
render: Example, | ||
}; | ||
|
||
export const args = { | ||
index: 0, | ||
}; |