DateInput
=========

Date input based around input type=date.

*   GitHub: [BonnierNews/dn-design-system/web/src/components/date-input](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/date-input)
*   Storybook: [Form > DateInput](https://designsystem.dn.se/?path=/docs/basic-form-dateinput--docs)
    
    The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use "@bonniernews/dn-design-system-web/components/date-input/date-input";`
    

| Name | Description | Default |
|:--- | :--- | :--- |
| name\* | Used as both the name and id of the date input.<br />string | \- |
| label\* | Needed for accessibility, but will be visually hidden.<br />string | \- |
| forcePx | Fixed pixel value is used for typography to prevent scaling based on html font-size<br />boolean | \- |
| autofocus | boolean | \- |
| error | boolean | \- |
| errorMessage | string | \- |
| helpText | string | \- |
| placeholder | string | \- |
| value | Date value in YYYY-MM-DD format, or an empty string for no date.<br />string | \- |
| classNames | Ex. "my-special-class"<br />string | ", " |
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |

```jsx
<DateInput
  label="Välj datum"
  name="select-date"
  value="2026-10-20"
/>
```