@postnord/web-components
Version:
PostNord Web Components
1,573 lines (1,572 loc) • 94.7 kB
JSON
{
"version": 1.1,
"tags": [
{
"name": "pn-accordion",
"description": {
"kind": "markdown",
"value": "The `pn-accordion` is a wrapper for `pn-accordion-row` components.\nThis component gives the accordion rows some space between each one and provides the `single` feature.\nWhich will force the rule that only a single row to be open at one time."
},
"attributes": [
{
"name": "single",
"description": "Only allow a single row to be open at once."
},
{
"name": "transparent",
"description": "Optional prop that removes the default white background on the accordion row."
}
]
},
{
"name": "pn-accordion-row",
"description": {
"kind": "markdown",
"value": "Use this row component inside a `pn-accordion` to create an accordion group.\n\n**Note**: you can use the `pn-accordion-row` without the parent accordion.\nBut you will have to style the gap between each row."
},
"attributes": [
{
"name": "buttonid",
"description": "Optional unique id for the `summary` element."
},
{
"name": "contentid",
"description": "Optional unique id for the `div` element containing the content."
},
{
"name": "label",
"description": "The label/title of the accordion row, you can also pass a slot with the name \"label\" if you want to put custom HTML content in there."
},
{
"name": "state",
"description": "The open/close status of the accordion row."
},
{
"name": "transparent",
"description": "Optional prop that removes the default white background on the accordion row."
}
]
},
{
"name": "pn-action-menu",
"description": {
"kind": "markdown",
"value": "Create a list of actions in an accessible way.\n\nOption types include:\n\n- Regular button, click and it will collapse the menu,\n- Checkbox/radio, toggle the option on/off\n- Link, behaves like a regular `a[href]` element.\n\nYou can group these actions in groups and/or sub menus.\n\n- `group`, an array of options. The label will act as a title for the items.\n- `options`, an array of options. These items will appear in a sub-menu that can be toggled."
},
"attributes": [
{
"name": "language",
"description": "Manually set the language.",
"values": [
{
"name": "da"
},
{
"name": "en"
},
{
"name": "fi"
},
{
"name": "no"
},
{
"name": "sv"
}
]
},
{
"name": "menu-id",
"description": "Set a custom ID for the menu."
},
{
"name": "menu-left",
"description": "Prefer that the submenus opens to the left, if there is enough space."
},
{
"name": "menu-up",
"description": "Prefer that the menu open upwards, if there is enough space."
},
{
"name": "open",
"description": "Open/close the action menu manually."
}
]
},
{
"name": "pn-button",
"description": {
"kind": "markdown",
"value": "The `pn-button` is built with a native `button` or `a` element, if you use the `href` attribute."
},
"attributes": [
{
"name": "appearance",
"description": "Select the button appearance: default (blue), `light` (white) and `warning` (red).",
"values": [
{
"name": "light"
},
{
"name": "warning"
}
]
},
{
"name": "ariacontrols",
"description": "HTML aria-controls attribute."
},
{
"name": "ariacurrent",
"description": "HTML aria-current attribute."
},
{
"name": "ariaexpanded",
"description": "HTML aria-expanded attribute."
},
{
"name": "ariahaspopup",
"description": "HTML aria-haspopup attribute."
},
{
"name": "arialabel",
"description": "HTML aria-label attribute."
},
{
"name": "arialabelledby",
"description": "HTML aria-labelledby attribute."
},
{
"name": "ariapressed",
"description": "HTML aria-pressed attribute."
},
{
"name": "button-id",
"description": "HTML ID."
},
{
"name": "download",
"description": "The download attribute of the link."
},
{
"name": "form",
"description": "Connect this button to a HTML form."
},
{
"name": "href",
"description": "Pass an href to make the button into link (a-tag)."
},
{
"name": "icon",
"description": "The SVG content of the icon you want."
},
{
"name": "icon-only",
"description": "Turn the button into an icon only. Requires `icon` and one of the following props to work: `tooltip`, `arialabel` or `arialabelledby`."
},
{
"name": "label",
"description": "The label of the button, this is the same as using the default slot."
},
{
"name": "left-icon",
"description": "Place the `icon` to the left of the button."
},
{
"name": "loading",
"description": "Display the loading indicator."
},
{
"name": "no-tab",
"description": "HTML tabindex."
},
{
"name": "rel",
"description": "The rel attribute of the link."
},
{
"name": "small",
"description": "Use the small button."
},
{
"name": "target",
"description": "The target attribute of the link."
},
{
"name": "tooltip",
"description": "When the user focus/hover the button, the `tooltip` text will show up."
},
{
"name": "tooltip-up",
"description": "Prefer the tooltip to open upwards. Will still go downwards if there is no space."
},
{
"name": "type",
"description": "Select HTML button type.",
"values": [
{
"name": "button"
},
{
"name": "reset"
},
{
"name": "submit"
}
]
},
{
"name": "variant",
"description": "Select the button variant: default (colored background), `outlined` (bordered, no background) and `borderless` (borderless, no background).",
"values": [
{
"name": "borderless"
},
{
"name": "outlined"
}
]
}
]
},
{
"name": "pn-button-dropdown",
"description": {
"kind": "markdown",
"value": "The open/closing of the dropdown is handled by the component itself."
},
"attributes": [
{
"name": "appearance",
"description": "Select between `light` and `warning`.",
"values": [
{
"name": "light"
},
{
"name": "warning"
}
]
},
{
"name": "icon",
"description": "The optional SVG content of the icon you want."
},
{
"name": "label",
"description": "The required label on the button."
},
{
"name": "open",
"description": "Open/close the dropdown without user interaction."
},
{
"name": "small",
"description": "Smaller button."
},
{
"name": "tooltip",
"description": "Tooltip (required for Icon Only)."
},
{
"name": "variant",
"description": "Select between `outlined` and `borderless`.",
"values": [
{
"name": "borderless"
},
{
"name": "outlined"
}
]
}
]
},
{
"name": "pn-card",
"description": {
"kind": "markdown",
"value": "The card component is more than just a navigational element.\nIt is a flexible component that can be used as a product item, a clickable link card, etc...\n\nSetting the `href` prop will transform the entire `pn-card` into a clickable element.\nIf you need content to be interactable inside the card, do not use the `href` prop."
},
"attributes": [
{
"name": "aspect-ratio",
"description": "Select image aspect ratio. Example: '3/3', '16/9'."
},
{
"name": "card-id",
"description": "Set a HTML id for the card. Optional and not required."
},
{
"name": "horizontal",
"description": "Uee the horizontal card layout."
},
{
"name": "href",
"description": "The card link."
},
{
"name": "href-label",
"description": "The link text."
},
{
"name": "icon",
"description": "The link icon. Defaults to `arrow_right` or `open_in_new` if `target=\"_blank\"`."
},
{
"name": "label",
"description": "Headline of the card. Will act as label for the link if there is no `href-label` set."
},
{
"name": "label-tag",
"description": "The label HTML tag. Default is `h3`.",
"values": [
{
"name": "h2"
},
{
"name": "h3"
},
{
"name": "h4"
},
{
"name": "h5"
},
{
"name": "h6"
},
{
"name": "p"
}
]
},
{
"name": "overline",
"description": "Set a smaller text above the `label` text."
},
{
"name": "rel",
"description": "The rel attribute of the link."
},
{
"name": "reverse",
"description": "Reverse the order of which the image will wrap."
},
{
"name": "target",
"description": "The target attribute of the link."
},
{
"name": "text",
"description": "Text content of the card."
}
]
},
{
"name": "pn-checkbox",
"description": {
"kind": "markdown",
"value": "The `pn-checkbox` is built with a native `input[type=\"checkbox\"]` in the background.\nThis means you can use native events to listen to the changes."
},
"attributes": [
{
"name": "checkboxid",
"description": "A unique HTML ID for the checkbox."
},
{
"name": "checked",
"description": "Programmatically check the input."
},
{
"name": "disabled",
"description": "Disable the checkbox."
},
{
"name": "expand",
"description": "Allow the checkbox to control the slot area \"content\".\nWhen checked, the area is visible, when unchecked, the area is hidden.\n\nThe prop `tile` must be used at the same time."
},
{
"name": "helpertext",
"description": "This adds an optional helpertext under the label."
},
{
"name": "icon",
"description": "Add an icon on the right of your checkbox tile. The `tile` prop must be `true` for the icon to work."
},
{
"name": "indeterminate",
"description": "Sets the checkbox to an indeterminate state, allowing for a mixed or intermediate checkbox state."
},
{
"name": "invalid",
"description": "If set to true, color scheme will turn red, indicating that there is an issue related to the checkbox."
},
{
"name": "label",
"description": "The checkbox label, this is required for the checkbox to be 100% accessible out of the box."
},
{
"name": "name",
"description": "The name of the checkbox group."
},
{
"name": "pn-aria-label",
"description": "Provide the label via an aria attribute.\nWe strongly recommend you use the `label` prop instead."
},
{
"name": "pn-aria-labelledby",
"description": "Provide the label from another element via its ID.\nWe strongly recommend you use the `label` prop instead."
},
{
"name": "pn-id",
"description": "A unique HTML ID for the checkbox."
},
{
"name": "required",
"description": "Set the checkbox as required."
},
{
"name": "tile",
"description": "Turn the checkbox into a clickable tile. A border and padding is added.\n\n**Do not** use interactive elements (links/buttons) inside of the slots when using this prop.\nAn exception is made when using the `tile` + `expand` props together,\nwhich allows you to use interactive elements."
},
{
"name": "value",
"description": "This will be emitted on change and input events."
}
]
},
{
"name": "pn-choice-chip",
"description": {
"kind": "markdown",
"value": "The `pn-choice-chip` is built with a native `input[type=\"checkbox|radio\"]` in the background.\nThis means you can use native events to listen to the changes."
},
"attributes": [
{
"name": "checked",
"description": "Programatically check the input."
},
{
"name": "choiceid",
"description": "A unique HTML ID for the choice chip."
},
{
"name": "disabled",
"description": "Disable the input."
},
{
"name": "icon",
"description": "Add an icon to the choice chip."
},
{
"name": "label",
"description": "The choice chip label. This is required for the component to be accessible."
},
{
"name": "large",
"description": "Use the large size for the choice chip."
},
{
"name": "name",
"description": "The name of the checkbox group. This is required if you use the `radio` prop."
},
{
"name": "pn-id",
"description": "A unique HTML ID for the choice chip"
},
{
"name": "radio",
"description": "Make the choice chip a radio input. By default, it behaves as a checkbox.\nYou must assign a `name` for the radio to work."
},
{
"name": "required",
"description": "Set the input as required."
},
{
"name": "small",
"description": "Use the small size for the choice chip."
},
{
"name": "value",
"description": "This will be emitted on change and input."
}
]
},
{
"name": "pn-counter",
"description": {
"kind": "markdown",
"value": "The `pn-counter` is an input with a button on each side that can be used to increase and decrease the input value."
},
"attributes": [
{
"name": "compact",
"description": "Use the compact label variant."
},
{
"name": "counterid",
"description": "Set a unique HTML ID for the counter."
},
{
"name": "disabled",
"description": "Set the counter as disabled."
},
{
"name": "helpertext",
"description": "Set a helpertext for the counter."
},
{
"name": "hide-tooltips",
"description": "Hide the tooltips for the increase/decrease button."
},
{
"name": "label",
"description": "Label for the counter. This is required for the counter to be 100% accessible out of the box."
},
{
"name": "label-decrease",
"description": "Text for the decrease button. Default is \"Decrease\"."
},
{
"name": "label-increase",
"description": "Text for the increase button. Default is \"Increase\"."
},
{
"name": "language",
"description": "Set the language manually for the built in translations.",
"values": [
{
"name": "da"
},
{
"name": "en"
},
{
"name": "fi"
},
{
"name": "no"
},
{
"name": "sv"
}
]
},
{
"name": "list",
"description": "Suggest values for the counter input."
},
{
"name": "max",
"description": "Maximum value."
},
{
"name": "max-message",
"description": "Set a message that shows below input when user wants to set a value that is above `max`. Default is \"Maximum value is x\""
},
{
"name": "min",
"description": "Minimum value."
},
{
"name": "min-message",
"description": "Set a message that shows below input when user wants to set a value that is below `min`. Default is \"Minimum value is x\""
},
{
"name": "name",
"description": "HTML input name."
},
{
"name": "pn-aria-label",
"description": "Provide the label via an aria attribute.\nWe strongly recommend you use the `label` prop instead."
},
{
"name": "pn-aria-labelledby",
"description": "Provide the label from another element via its ID.\nWe strongly recommend you use the `label` prop instead."
},
{
"name": "pn-id",
"description": "Set a unique HTML ID for the counter."
},
{
"name": "readonly",
"description": "Set the counter as readonly."
},
{
"name": "required",
"description": "Set the counter as required."
},
{
"name": "step",
"description": "Increase/decrease the value in steps, default is 1."
},
{
"name": "value",
"description": "Set a predefined value."
}
]
},
{
"name": "pn-date-picker",
"description": {
"kind": "markdown",
"value": "The date picker allows a single or a range of dates to be selected.\n\nBased on the `format` prop, separators will automatically be added if you type the date.\n\nYou can navigate the calendar grid with your keyboard."
},
"attributes": [
{
"name": "autocomplete",
"description": "Set the input `autocomplete` attribute."
},
{
"name": "calendar-up",
"description": "Make the calendar open upwards by default. Opens downwards if there is not enough space."
},
{
"name": "compact",
"description": "Set the date picker label as compact. If used, the `placeholder` will no longer be displayed."
},
{
"name": "date-id",
"description": "Set a custom ID for the calendar."
},
{
"name": "disable-max-length",
"description": "If you use a format with an unknown length, disable the max length."
},
{
"name": "disable-type-ahead",
"description": "Disable the automatic insertion of separators when typing in the input."
},
{
"name": "disable-weekends",
"description": "Remove the option to select dates on weekends."
},
{
"name": "disabled",
"description": "Set the date picker as disabled."
},
{
"name": "disabled-dates",
"description": "Individual dates you want to disable. Use a comma separated string.\n\nRemember to use the same format that you have in the `format` prop."
},
{
"name": "end",
"description": "Set a predefined value for the from date. (input value end)"
},
{
"name": "end-placeholder",
"description": "Placeholder for end date (defaults to the format prop)."
},
{
"name": "error",
"description": "Set an error message for the date picker. Overwrites the helpertext if used at the same time."
},
{
"name": "format",
"description": "Set the date format of the value.\n\nWhile you can set any date value from the Dayjs documentation,\nwe strongly recommend you pick a simple format that you can also type manually."
},
{
"name": "helpertext",
"description": "Provide a helpertext for the date input."
},
{
"name": "invalid",
"description": "Trigger the invalid state without an error message."
},
{
"name": "label-from",
"description": "Set a label for the from date."
},
{
"name": "label-to",
"description": "Set a label for the to date."
},
{
"name": "language",
"description": "Manually set language; this will be inherited from the topbar.",
"values": [
{
"name": "da"
},
{
"name": "en"
},
{
"name": "fi"
},
{
"name": "no"
},
{
"name": "sv"
}
]
},
{
"name": "list",
"description": "Set the input `list` attribute for the first date input."
},
{
"name": "list-end",
"description": "Set the input `list` attribute for the second date input."
},
{
"name": "max-date",
"description": "Latest date possible, this will determine how many years forward the date picker will show.\n\nRemember to use the same format that you have in the `format` prop."
},
{
"name": "min-date",
"description": "Earliest date possible, this will determine how many years back the date picker will show.\n\nRemember to use the same format that you have in the `format` prop."
},
{
"name": "name",
"description": "HTML input name"
},
{
"name": "name-end",
"description": "HTML input name"
},
{
"name": "pattern",
"description": "Set the HTML pattern prop on the input elements. Make sure it matches the format."
},
{
"name": "placeholder",
"description": "Placeholder for the input field (defaults to the format prop)."
},
{
"name": "placeholder-end",
"description": "Placeholder for end date (defaults to the format prop)."
},
{
"name": "pn-aria-label",
"description": "Provide the label via an aria attribute.\nWe strongly recommend you use the `label-from` prop instead."
},
{
"name": "pn-aria-label-end",
"description": "Provide the label for the end input via an aria attribute.\nWe strongly recommend you use the `label-to` prop instead."
},
{
"name": "pn-aria-labelledby",
"description": "Provide the label from another element via its ID.\nWe strongly recommend you use the `label-from` prop instead."
},
{
"name": "pn-aria-labelledby-end",
"description": "Provide the label for the end input from another element via its ID.\nWe strongly recommend you use the `label-to` prop instead."
},
{
"name": "pn-id",
"description": "Set a custom ID for the calendar. If you use `range`, the end input will use `${pn-id}-end`."
},
{
"name": "range",
"description": "Allow the selection of a date range."
},
{
"name": "range-limit",
"description": "Set a limit on how many days one may select.\nBy default, you can select an unlimited range."
},
{
"name": "readonly",
"description": "Set the date picker as readonly."
},
{
"name": "required",
"description": "Set the date picker as required."
},
{
"name": "start",
"description": "Set a predefined value for the from date (input value)."
},
{
"name": "view",
"description": "The calendar grid is shown as default. You can set either `months` or `years` as your first choice.",
"values": [
{
"name": "calendar"
},
{
"name": "months"
},
{
"name": "years"
}
]
},
{
"name": "week-numbers",
"description": "Show weekend numbers to the left of the calendar grid."
}
]
},
{
"name": "pn-fieldset",
"description": {
"kind": "markdown",
"value": "The fielset is a wrapper to give context and information about inputs. Most commonly, a set of radio/checkboxes.\nHowever, you may include any type of input such as textareas, toggles and selects."
},
"attributes": [
{
"name": "disabled",
"description": "Disable all of the inputs inside of the fieldset."
},
{
"name": "error",
"description": "Error message, applies warning styles and icon."
},
{
"name": "fieldset-id",
"description": "Set a custom ID for the fieldset."
},
{
"name": "form",
"description": "The id of the form you want the fieldset to be part of.\nIf you want the inputs inside to be associated with a specific form, you need to set on those elements directly."
},
{
"name": "helpertext",
"description": "Text message underneath the legend for more instruction or hints on how to fill in controls correctly."
},
{
"name": "invalid",
"description": "Set the fieldset as `invalid`, will add red error styles."
},
{
"name": "legend",
"description": "The legend provides a caption for the fieldset group.\nThis should be a question or heading that describes the inputs/fields."
},
{
"name": "name",
"description": "Give the fieldset a HTML name."
},
{
"name": "pn-id",
"description": "Set a custom ID for the fieldset."
}
]
},
{
"name": "pn-file-upload",
"description": {
"kind": "markdown",
"value": "Users can drop files directly into the upload area of the component\nor simply click on it to open their native file explorer."
},
"attributes": [
{
"name": "accept",
"description": "Set which file types the input accepts. Ex: .docs,.xml"
},
{
"name": "capture",
"description": "Use the capture mode.",
"values": [
{
"name": "environment"
},
{
"name": "user"
}
]
},
{
"name": "disabled",
"description": "Disable the input."
},
{
"name": "helpertext",
"description": "The helpertext defaults to \"Supported formats {x} and max filesize {y}\",\nif there is a value set for the prop `accept`."
},
{
"name": "hide-progress",
"description": "Always hide the progress bar, even when upload has begun."
},
{
"name": "label",
"description": "The default label is \"Click or drag a file here\"."
},
{
"name": "language",
"description": "Manually set the language.",
"values": [
{
"name": "da"
},
{
"name": "en"
},
{
"name": "fi"
},
{
"name": "no"
},
{
"name": "sv"
}
]
},
{
"name": "limit",
"description": "Set maximum amount of files to be selected.\nAny value above 1 will force the `multiple` to be `true`."
},
{
"name": "max-size",
"description": "Set the maximum upload size."
},
{
"name": "multiple",
"description": "Allow multiple files to be selected. Will be overwritten to true, if `limit` is above 1."
},
{
"name": "name",
"description": "Set a HTML name."
},
{
"name": "pn-id",
"description": "Set a custom ID for the file upload."
},
{
"name": "required",
"description": "Set the input as required."
}
]
},
{
"name": "pn-footer",
"description": {
"kind": "markdown",
"value": "The default market and language is SE/en.\n\nMake sure you set the market **and** language prop.\nExample: Setting the `language` prop `da` will not display anything, as `da` does not exist on the `SE` market."
},
"attributes": [
{
"name": "language",
"description": "Set the language for the footer.",
"values": [
{
"name": "da"
},
{
"name": "en"
},
{
"name": "fi"
},
{
"name": "no"
},
{
"name": "sv"
}
]
},
{
"name": "market",
"description": "Set the market for the footer.",
"values": [
{
"name": "DK"
},
{
"name": "FI"
},
{
"name": "NO"
},
{
"name": "SE"
}
]
}
]
},
{
"name": "pn-header",
"description": {
"kind": "markdown",
"value": "The header component is a simple layout component used to display a page heading with optional text, buttons and tablist menu."
},
"attributes": [
{
"name": "go-back-href",
"description": "The href for the go back link. If this is provided a button be displayed."
},
{
"name": "go-back-text",
"description": "The text for the back link."
},
{
"name": "heading",
"description": "The `h1` text content."
},
{
"name": "language",
"description": "Set the language manually, only use this prop if the pnTopbar is not loaded. Supported: sv, en, da, fi and no.",
"values": [
{
"name": "da"
},
{
"name": "en"
},
{
"name": "fi"
},
{
"name": "no"
},
{
"name": "sv"
}
]
},
{
"name": "max-width",
"description": "Set a inner container max-width, any width CSS value is accepted."
}
]
},
{
"name": "pn-icon",
"description": {
"kind": "markdown",
"value": "The `pn-icon` is a wrapper for an SVG string.\nWhile its built with PostNords specific icon dimensions in mind (24x24px), you can use any SVG content in this component.\nAs long as its 3x3 in size, there should be no problem.\n\nThe color feature will not overwrite the color of flags."
},
"attributes": [
{
"name": "color",
"description": "Color the icon with one of the following colors from our library.\nHas no effects if you use flags from our library.",
"values": [
{
"name": "black"
},
{
"name": "blue200"
},
{
"name": "blue25"
},
{
"name": "blue400"
},
{
"name": "blue50"
},
{
"name": "blue700"
},
{
"name": "blue900"
},
{
"name": "coral200"
},
{
"name": "coral25"
},
{
"name": "coral400"
},
{
"name": "coral50"
},
{
"name": "coral700"
},
{
"name": "coral900"
},
{
"name": "gray100"
},
{
"name": "gray200"
},
{
"name": "gray25"
},
{
"name": "gray400"
},
{
"name": "gray50"
},
{
"name": "gray700"
},
{
"name": "gray900"
},
{
"name": "green200"
},
{
"name": "green25"
},
{
"name": "green400"
},
{
"name": "green50"
},
{
"name": "green500"
},
{
"name": "green700"
},
{
"name": "green900"
},
{
"name": "orange200"
},
{
"name": "orange25"
},
{
"name": "orange400"
},
{
"name": "orange50"
},
{
"name": "orange500"
},
{
"name": "orange700"
},
{
"name": "orange900"
},
{
"name": "warning"
},
{
"name": "white"
}
]
},
{
"name": "icon",
"description": "The SVG content of the icon you want to use."
},
{
"name": "small",
"description": "Make the icon small (16 instead of 24px)."
}
]
},
{
"name": "pn-illustration",
"description": {
"kind": "markdown",
"value": "The `pn-illustration` is a wrapper for an SVG string.\nThe component will look at the viewBox property of the SVG to determine the default width and height,\nbut you can also set these manually with the `width` and `height` props.\nSetting the `fill` prop will make the illustration fill its parent container, which is useful for responsive designs."
},
"attributes": [
{
"name": "fill",
"description": "Make the SVG fill to its parent size (sets width/height 100% and `display: block` instead of `inline-block`)"
},
{
"name": "height",
"description": "Set the height of the SVG element. Any valid CSS height value is allowed"
},
{
"name": "illustration",
"description": "The SVG content of the illustration you want to use. The viewBox property will be used to determine width/height"
},
{
"name": "width",
"description": "Set the width of the SVG element. Any valid CSS width value is allowed"
}
]
},
{
"name": "pn-input",
"description": {
"kind": "markdown",
"value": "The `pn-input` is a regular `input` but styled. This means you can use native events to listen to the changes.\nAlways use the `label` prop to make sure the input is accessible."
},
"attributes": [
{
"name": "ariacontrols",
"description": "Set the ID of what this input controls."
},
{
"name": "arialabel",
"description": "While you can use the `aria-label`, using a `label` is far more accessible."
},
{
"name": "autocomplete",
"description": "Let the browser know what type of autocorrects the input should use.\nWorks much better if a `name` and `pn-id` is supplied."
},
{
"name": "compact",
"description": "Use the compact label variant. The `placeholder` you provide will not be visible if used at the same time."
},
{
"name": "disabled",
"description": "Set the input as `disabled`."
},
{
"name": "error",
"description": "Set the input as `invalid` and display an error message (applies the same style as `invalid`).\n\nError message; will take precedence over helpertext if both are provided."
},
{
"name": "helpertext",
"description": "Text message placed underneath the input field."
},
{
"name": "icon",
"description": "Select an icon to display before the input field value.\n`icon` takes precedence over the `text-prefix` prop."
},
{
"name": "inputid",
"description": "Set a custom ID for the input (default is a generated UUID)."
},
{
"name": "inputmode",
"description": "Hint the browser about what type of virtual keyboard should be used.\nThe browser will be able to decide this on its own most of the time,\nespecially if you use the `type`, `name` and `inputid` props.\n\nLeave empty or with a `''` value if you want the browsers default behaviour (`text`).",
"values": [
{
"name": "decimal"
},
{
"name": "email"
},
{
"name": "none"
},
{
"name": "numeric"
},
{
"name": "search"
},
{
"name": "tel"
},
{
"name": "text"
},
{
"name": "url"
}
]
},
{
"name": "invalid",
"description": "Set the input as `invalid`. Provides a red color and red warning icon."
},
{
"name": "label",
"description": "Text label placed above the input field."
},
{
"name": "language",
"description": "Set the language manually for the translations of show/hide/clear button text.\nNot needed if you have the pntopbar on the page.",
"values": [
{
"name": "da"
},
{
"name": "en"
},
{
"name": "fi"
},
{
"name": "no"
},
{
"name": "sv"
}
]
},
{
"name": "list",
"description": "Point to a datalist element for this input."
},
{
"name": "max",
"description": "Set the `max` value of the `number` input."
},
{
"name": "maxlength",
"description": "The maximum number of characters the user should be able to add, also adds a visible counter."
},
{
"name": "min",
"description": "Set the `min` value of the `number` input."
},
{
"name": "name",
"description": "HTML input name. Setting a name will help the browser understand what type of data the input have\nand can better assist with autofill data based on previous entires much better."
},
{
"name": "pattern",
"description": "Pattern prop."
},
{
"name": "placeholder",
"description": "Provide a placeholder text. Remember that this is no replacement for a label.\nThe placeholder should be a nice addition to the label/helpertext, not important information."
},
{
"name": "pn-aria-controls",
"description": "Set the ID of what this input controls."
},
{
"name": "pn-aria-label",
"description": "Provide the label via an aria attribute.\nWe strongly recommend you use the `label` prop instead."
},
{
"name": "pn-aria-labelledby",
"description": "Provide the label from another element via its ID.\nWe strongly recommend you use the `label` prop instead."
},
{
"name": "pn-id",
"description": "Set a custom ID for the input (default is a generated UUID)."
},
{
"name": "readonly",
"description": "Set the input as `readonly`."
},
{
"name": "required",
"description": "Set the input as `required`."
},
{
"name": "step",
"description": "Set a `step` for the number input."
},
{
"name": "text-prefix",
"description": "Set a small text before the input field value.\nCannot be used together with an `icon` at the same time."
},
{
"name": "text-suffix",
"description": "Set a small text after the input field value.\nCannot be used with the `text-prefix` prop at the same time."
},
{
"name": "type",
"description": "pn-input supports: `text`, `password`, `url`, `tel`, `search`, `number` & `email`.",
"values": [
{
"name": "email"
},
{
"name": "number"
},
{
"name": "password"
},
{
"name": "search"
},
{
"name": "tel"
},
{
"name": "text"
},
{
"name": "url"
}
]
},
{
"name": "valid",
"description": "Set the input as `valid`. Provides a green color and a check icon."
},
{
"name": "value",
"description": "Set the value of the input."
}
]
},
{
"name": "pn-modal",
"description": {
"kind": "markdown",
"value": "Present content in a modal that overlays everything on the current page.\nUse the prop `open` to toggle the visiblity.\nUse the event `modalToggle` to determine when the modal is being closed/opened by the user."
},
"attributes": [
{
"name": "allow-overflow",
"description": "Allow overflow *when* it is possible.\nDo not use if you have a lot of conditional rendering inside the modal as it can cause layout shifts."
},
{
"name": "helpertext",
"description": "Set a descriptive text for the modal."
},
{
"name": "hide-close",
"description": "Hide the close button. If you enable this, make sure you build your own cancel button."
},
{
"name": "label",
"description": "Set a label for the modal."
},
{
"name": "language",
"description": "Set the language.",
"values": [
{
"name": "da"
},
{
"name": "en"
},
{
"name": "fi"
},
{
"name": "no"
},
{
"name": "sv"
}
]
},
{
"name": "max-width",
"description": "Define your own max width of the modal. Default is `45em`."
},
{
"name": "open",
"description": "Use this prop if you want to control the visibility of the modal programmatically."
},
{
"name": "persistent",
"description": "Prevent users from closing the modal by clicking on the backdrop or the `ESC` key."
},
{
"name": "pn-id",
"description": "Set a custom HTML id."
},
{
"name": "sheet",
"description": "Use the `sheet` visual. Aligns the modal to the right instead of the center."
}
]
},
{
"name": "pn-multiselect",
"description": {
"kind": "markdown",
"value": "The `pn-multiselect` gets its options via javascript.\n\nNative HTML does not accept arrays of objects. Most frameworks solves this automatically (Vue, react, etc...),\nbut keep this in mind if you use this component outside of a framework environment."
},
"attributes": [
{
"name": "all-value",
"description": "Set a custom value for the \"Select all value\" option."
},
{
"name": "bottom",
"description": "Force the dropdown to always open downwards."
},
{
"name": "compact",
"description": "Set the date picker label as compact. If used, the `placeholder` will no longer be displayed."
},
{
"name": "disabled",
"description": "Disable the select."
},
{
"name": "error",
"description": "Display an error message and trigger the invalid state."
},
{
"name": "helpertext",
"description": "Display a helper text underneath the select"
},
{
"name": "icon",
"description": "Display an icon to the left of the select input"
},
{
"name": "invalid",
"description": "Trigger the invalid state."
},
{
"name": "item-count",
"description": "Decide how many items should be shown before ellipsis. Requires the `search` prop to work."
},
{
"name": "label",
"description": "Label placed above the select"
},
{
"name": "language",
"description": "Manually set the language, not needed if you have the pnTopbar available",
"values": [
{
"name": "da"
},
{
"name": "en"
},
{
"name": "fi"
},
{
"name": "no"
},
{
"name": "sv"
}
]
},
{
"name": "max-height",
"description": "The component will automatically set the max height of the dropdown list on its own.\nIt takes the `pn-topbar` into account and will open in the direction that fits best.\nUse this prop to override this behaviour and use a custom max-height."
},
{
"name": "name",
"description": "HTML name of the checkbox elements. Used for each checkbox inside the multiselect."
},
{
"name": "placeholder",
"description": "This is what will be shown on load if no value is used.\nThe `placeholder` will override the default text used if you have the `search` prop active."
},
{
"name": "pn-aria-label",
"description": "Provide the label via an aria attribute.\nWe strongly recommend you use the `label` prop instead."
},
{
"name": "pn-aria-labelledby",
"description": "Provide the label from another element via its ID.\nWe strongly recommend you use the `label` prop instead."
},
{
"name": "pn-id",
"description": "Set a custom ID for the select."
},
{
"name": "required",
"description": "Set the select as required."
},
{
"name": "search",
"description": "Allow the user to search among the options.\nThe selected options will now display underneath the multiselect element."
},
{
"name": "search-query",
"description": "Set the search query of the multiselect."
},
{
"name": "select-all",
"description": "Adds a \"Select all\" option into the list.\nIf you use the search feature at the same time, clicking this option will only toggle the options found."
},
{
"name": "select-id",
"description": "Select HTML id"
},
{
"name": "select-name",
"description": "HTML name of the input element."
},
{
"name": "top",
"description": "Force the dropdown to always open upwards."
}