### Card Component with Tags and Image (HTML) Source: https://punkt.oslo.kommune.no/latest/komponenter-og-maler/komponenter/card A basic implementation of the Card component using HTML. It includes example data for tags and an image, demonstrating how to structure content within the card. This snippet is platform-agnostic and serves as a structural example. ```html

Dette er en tekst om barnehagen

``` -------------------------------- ### Install and Run axe-cli for WCAG Testing Source: https://punkt.oslo.kommune.no/latest/universell-utforming/testverktoy This snippet demonstrates how to install the axe-cli tool globally using npm and then run it against a local development server to test specified pages for WCAG compliance. It also shows an example of the output when a violation is found. ```shell $ npm install @axe-core/cli -g ``` ```shell $ axe http://localhost:3000 http://localhost:3000/komponenter/badge ``` ```text Violation of "landmark-no-duplicate-banner" with 1 occurrences! Ensures the document has at most one banner landmark. Correct invalid elements at: - #pkt-header For details, see: https://dequeuniversity.com/rules/axe/4.4/landmark-no-duplicate-banner ``` -------------------------------- ### PktIcon Component Example Source: https://punkt.oslo.kommune.no/latest/komponenter-og-maler/komponenter/icon An example of how to use the PktIcon component, likely within a web framework. This snippet demonstrates the basic structure for rendering an icon, with 'content' likely referring to the specific icon identifier. ```html

Kodebygger

PktIcon

Innhold

``` -------------------------------- ### Web Component Messagebox Source: https://punkt.oslo.kommune.no/latest/komponenter-og-maler/komponenter/messagebox Example of using the Messagebox as a web component. This is a framework-agnostic way to implement the component, useful for plain HTML or other JavaScript frameworks. It allows for similar customization as the React version. ```html Dette er innholdet i meldingsboksen. ``` -------------------------------- ### Default Text Styling Examples (HTML) Source: https://punkt.oslo.kommune.no/latest/grunnleggende/ressurser/typografi Provides examples of basic HTML text elements and their default styling within the Punkt CSS framework, including paragraphs, italic, small text, bold text. ```html

Dette er vanlig brødtekst.

Dette er skrevet i kursiv.

Dette er skrevet i liten tekst.

Dette er skrevet i fet tekst.

``` -------------------------------- ### Punkt Spacing CSS Helper Classes Examples Source: https://punkt.oslo.kommune.no/latest/grunnleggende/ressurser/spacing Demonstrates the usage of Punkt's CSS helper classes for applying responsive margins and padding. These classes follow a pattern of {type}{direction}-{size} and can include responsive modifiers like --{breakpoint}-up. ```html

Margin bunn

margin høyre og padding topp

Horisontal padding

``` -------------------------------- ### Configure Responsive Gap/Gutter Sizes in Punkt Grid Source: https://punkt.oslo.kommune.no/latest/grunnleggende/ressurser/grid Shows how to manage responsive gap and gutter sizes within the `pkt-grid`. This example applies a 16px gap for mobile and increases it to 32px for tablets and larger screens using classes like `pkt-grid--gap-size-16` and `pkt-grid--gap-size-32-tablet-up`. ```html
.pkt-grid--gap-size-16 pkt-grid--gap-size-32-tablet-up
.pkt-grid--gap-size-16 pkt-grid--gap-size-32-tablet-up
.pkt-grid--gap-size-16 pkt-grid--gap-size-32-tablet-up
.pkt-grid--gap-size-16 pkt-grid--gap-size-32-tablet-up
``` -------------------------------- ### Implement Punkt Grid with Phablet Breakpoint Source: https://punkt.oslo.kommune.no/latest/grunnleggende/ressurser/grid Demonstrates the basic implementation of the `pkt-grid` component using the `pkt-grid--phablet` class. This sets up a grid layout that is responsive and adapts to different screen sizes, starting with a phablet breakpoint. The content scales with screen width, while gaps and margins remain consistent. ```html
.pkt-grid--phablet
``` -------------------------------- ### Progressbar Implementation in HTML Source: https://punkt.oslo.kommune.no/latest/komponenter-og-maler/komponenter/progressbar Shows the implementation of the progress bar using custom HTML elements. This example uses the 'pkt-progressbar' tag with attributes to define the title, minimum and maximum values, current value, and status type. ```html ``` -------------------------------- ### PktTextinput Component Example - React Source: https://punkt.oslo.kommune.no/latest/komponenter-og-maler/komponenter/textinput This code snippet demonstrates how to use the PktTextinput component in React. It shows basic configuration with a label, name, placeholder, help text, input type, ID, and wrapper usage. The component is designed for text input with optional helper text and validation. ```jsx ``` -------------------------------- ### Import PktInputWrapper i React Source: https://punkt.oslo.kommune.no/latest/komponenter-og-maler/komponenter/inputwrapper Dette kodeeksemplet viser hvordan du importerer PktInputWrapper-komponenten fra Punkt React-biblioteket. Dette er nødvendig for å bruke komponenten i React-applikasjoner. ```javascript import { PktInputWrapper } from '@oslokommune/punkt-react'; ``` -------------------------------- ### Import PktInputWrapper i Vanilla JS Source: https://punkt.oslo.kommune.no/latest/komponenter-og-maler/komponenter/inputwrapper Dette kodeeksemplet viser hvordan du importerer PktInputWrapper-komponenten for bruk i vanilje JavaScript-prosjekter ved hjelp av Punkt Elements JS-modulen. Sørg for at filstien til .js-filen er korrekt. ```javascript import @oslokommune/punkt-elements/dist/pkt-input-wrapper.js; ``` -------------------------------- ### Installere og bruke Punkt Elements (Web Components) Source: https://punkt.oslo.kommune.no/latest/grunnleggende/for-utviklere/kom-i-gang Installerer Punkt Elements-pakken og demonstrerer import og bruk av Web Components for tekstinput og knapper direkte i HTML. Anbefaler innpakking av reaktivt innhold. ```bash npm add @oslokommune/punkt-elements ``` ```javascript import @oslokommune/punkt-elements/dist/pkt-textinput.js; import @oslokommune/punkt-elements/dist/pkt-button.js; ``` ```html Dette er en knapp ``` -------------------------------- ### Import Loader Component (React) Source: https://punkt.oslo.kommune.no/latest/komponenter-og-maler/komponenter/loader This snippet demonstrates how to import the PktLoader component for use within a React application. It assumes the '@oslokommune/punkt-react' package is installed. ```javascript import { PktLoader } from '@oslokommune/punkt-react'; ``` -------------------------------- ### Alert Component - Implementation Source: https://punkt.oslo.kommune.no/latest/komponenter-og-maler/komponenter/alert Provides guidance on how to implement the Alert component using code, including options and testing. ```APIDOC ## Implementation in Code ### Options Alerts can accept a JSON list as an attribute/prop in `options`, or a series of `