2019-07-02 11:22:48 +00:00
|
|
|
# Text
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```js
|
|
|
|
import { Text } from 'asc-web-components';
|
|
|
|
```
|
|
|
|
|
|
|
|
### <Text.Headline>
|
|
|
|
|
2019-08-06 14:31:52 +00:00
|
|
|
A component that renders headline
|
2019-07-02 11:22:48 +00:00
|
|
|
|
|
|
|
#### Usage
|
|
|
|
|
|
|
|
```js
|
2019-08-06 14:31:52 +00:00
|
|
|
<Text.Headline as='h1' title='Some title'>
|
2019-07-02 11:22:48 +00:00
|
|
|
Some text
|
|
|
|
</Text.Headline>
|
|
|
|
```
|
|
|
|
|
2019-08-08 11:40:33 +00:00
|
|
|
##### If you need to override styles add forwardedAs instead of as
|
2019-08-06 14:31:52 +00:00
|
|
|
|
|
|
|
```js
|
|
|
|
|
2019-08-08 11:40:33 +00:00
|
|
|
const StyledHeadline = styled(Text.Headline)`
|
2019-08-06 14:31:52 +00:00
|
|
|
&:hover{
|
|
|
|
border-bottom: 1px dotted;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2019-08-08 11:40:33 +00:00
|
|
|
<StyledHeadline forwardedAs='h4' title='Some title'>
|
2019-08-06 14:31:52 +00:00
|
|
|
Some text
|
|
|
|
</StyledHeadline>
|
|
|
|
|
|
|
|
```
|
|
|
|
|
2019-07-02 11:22:48 +00:00
|
|
|
#### Properties
|
|
|
|
|
|
|
|
| Props | Type | Required | Values | Default | Description |
|
|
|
|
| ------------------ | -------- | :------: | --------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
2019-08-07 08:18:42 +00:00
|
|
|
| `color` | `string` | - | - | '#333333' | Specifies the headline color |
|
2019-08-06 14:31:52 +00:00
|
|
|
| `as ` | `string` | - | - | `h1` | Sets the tag through which to render the component |
|
2019-07-02 11:22:48 +00:00
|
|
|
| `title` | `bool` | - | - | - | Title |
|
|
|
|
| `truncate` | `bool` | - | - | false | Disables word wrapping |
|
|
|
|
| `isInline` | `bool` | - | - | false | Sets the 'display: inline-block' property |
|
2019-08-06 14:31:52 +00:00
|
|
|
| `size` | `oneOF` | - | `big`, `medium`, `small` | `big` | Sets the size of headline |
|
2019-07-02 11:22:48 +00:00
|
|
|
|