- GitHub: [BonnierNews/dn-design-system/../web/src/components/text-button](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/text-button)
- Storybook: [Buttons > TextButton](https://designsystem.dn.se/?path=/docs/basic-buttons-textbutton--docs)
- Storybook (Latest): [Buttons > TextButton](https://designsystem-latest.dn.se/?path=/docs/basic-buttons-textbutton--docs)

----

# TextButton

## Parameters

|parameter | type | required | options | default | description |
|:--- | :--- | :--- | :--- | :--- | :--- |
|text | String | yes | | | |
|hideTextOnMobile | bool | no | true, false | false | Text will be hidden on mobile, make sure to use with icon |
|size| String | no | default, small | default | |
|disabled | bool | no | true, false | false | Note: only works on button-tag, not on a-tag |
|fullWidth | bool | no | true, false | false | Button will be full width on both desktop and mobile |
|mobile.fullWidth | bool | no | true, false | false | Ex mobile: { fullWidth: true } |
|iconPosition | String | no | none, left, right | none | |
|iconName | String | no | add, arrow_back, arrow_forward etc | | For all available icons see: https://designsystem.dn.se/?path=/story/foundations-icons--all-icons |
|loading | bool | no | true, false | false | |
|href | String | no | | | If href is set the button will be rendered as an a-tag |
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|classNames | String | no | | | Ex. "my-special-class" |
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size

## Minimum requirement example

### Nunjucks

These are copy paste friendly examples to quickliy get started using a component.

```html
{% from '@bonniernews/dn-design-system-web/components/text-button/text-button.njk' import TextButton %}

{{ TextButton({
  text: 'My text button',
  iconPosition: 'right',
  iconName: 'arrow_forward'
})}}
```

### SCSS
```scss
@use "@bonniernews/dn-design-system-web/components/text-button/text-button";
```
