@fremtind/jkl-accordion-react
Advanced tools
Comparing version 1.0.0-alpha.13 to 1.0.0-alpha.14
@@ -6,2 +6,10 @@ # Change Log | ||
# [1.0.0-alpha.14](https://github.com/fremtind/jokul/compare/@fremtind/jkl-accordion-react@1.0.0-alpha.13...@fremtind/jkl-accordion-react@1.0.0-alpha.14) (2019-12-03) | ||
**Note:** Version bump only for package @fremtind/jkl-accordion-react | ||
# [1.0.0-alpha.13](https://github.com/fremtind/jokul/compare/@fremtind/jkl-accordion-react@1.0.0-alpha.12...@fremtind/jkl-accordion-react@1.0.0-alpha.13) (2019-11-13) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@fremtind/jkl-accordion-react", | ||
"version": "1.0.0-alpha.13", | ||
"version": "1.0.0-alpha.14", | ||
"publishConfig": { | ||
@@ -36,3 +36,3 @@ "access": "public" | ||
"dependencies": { | ||
"@fremtind/jkl-accordion": "^1.0.0-alpha.13", | ||
"@fremtind/jkl-accordion": "^1.0.0-alpha.14", | ||
"@fremtind/jkl-react-hooks": "^1.0.0-alpha.11", | ||
@@ -60,3 +60,3 @@ "@nrk/core-toggle": "^3.0.4" | ||
], | ||
"gitHead": "980cacb315aa36976f0b35e579c4325b3772a3a9" | ||
"gitHead": "7e41a79b40d4ca9310c6f5ae782433b6b0fc85c8" | ||
} |
@@ -10,1 +10,29 @@ # [`@fremtind/jkl-accordion-react`](https://fremtind.github.io/jokul/components/accordion/) | ||
[Lær hvordan du kan ta i bruk Jøkul](https://fremtind.github.io/jokul/developer/getting-started/) | ||
## Bruk av React-pakken | ||
### Installasjon | ||
1. Installér pakken med `yarn add @fremtind/jkl-accordion-react` eller `npm i @fremtind/jkl-accordion-react`. Stil-pakken blir automatisk installert som en avhengighet. | ||
2. Importer _både_ React-pakken (velg komponenten(e) du trenger) og stil-pakken i prosjektet ditt: | ||
```js | ||
import { Accordion, AccordionItem } from "@fremtind/jkl-accordion-react"; | ||
import "@fremtind/jkl-accordion/accordion.min.css"; | ||
``` | ||
### Bruk | ||
En enkel bruk av `Accordion` kan se slik ut: | ||
```jsx | ||
<Accordion> | ||
<AccordionItem title="Accordion #1">Her er det som går inni accordion. Det kan være så mangt.</AccordionItem> | ||
<AccordionItem title="Accordion #2">Her er annet innhold til accordion.</AccordionItem> | ||
</Accordion> | ||
``` | ||
Merk at `AccordionItem` kan ha annet innhold enn ren tekst. Komponenten tar inn prop-en `children` som er av typen `ReactNode.` | ||
Dersom det er ønskelig at komponenten er utvidet når komponenten lastes inn kan prop-en `startExpanded` benyttes. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26466
38