Skip to content

Commit

Permalink
more react things
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsnes committed Jun 18, 2024
1 parent 66e1fef commit 8bc0837
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion packages/react/stories/react-usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,32 @@ import { CodeSnippet } from '@doc-components';

<Meta title='Bruk React' />

# Hvordan bruke React
# Bruk

Introduksjon til bruk, regler og gotchas.

## Installasjon

For å bruke Designsystemet i React, så må du installere `@digdir/designsystemet-react`.

<CodeSnippet language='bash'>
{`
npm install @digdir/designsystemet-react
`}
</CodeSnippet>

Deretter kan du importere komponentene du trenger.

<CodeSnippet language='ts'>
{`
import { Button } from '@digdir/designsystemet-react';
<Button>Click me</Button>
`}
</CodeSnippet>

Alle komponentene som er tilgjengelige i Designsystemet er uten styling. Legg til styling ved å importere vår css pakke, `@digdir/designsystemet-css`.

## SSR

Alle våre komponenter er klient komponenter, og bruker `"use client"`.
Expand Down

0 comments on commit 8bc0837

Please sign in to comment.