DocSpace-buildtools/web/ASC.Web.Storybook/stories/text/body/README.md

53 lines
2.3 KiB
Markdown
Raw Normal View History

2019-07-02 11:22:48 +00:00
# Text
## Usage
```js
import { Text } from 'asc-web-components';
```
### <Text.Body>
2019-08-06 14:31:52 +00:00
Component that displays plain text
2019-07-02 11:22:48 +00:00
#### Usage
```js
2019-08-06 14:31:52 +00:00
<Text.Body as='p' title='Some title'>
2019-07-02 11:22:48 +00:00
Some text
</Text.Body>
2019-08-06 14:31:52 +00:00
```
##### If you need to override styles add forwardedAs instead of as
2019-08-06 14:31:52 +00:00
```js
const StyledText = styled(Text.Body)`
&:hover{
border-bottom: 1px dotted;
}
`;
<StyledText forwardedAs='span' title='Some title'>
2019-08-06 14:31:52 +00:00
Some text
</StyledText>
2019-07-02 11:22:48 +00:00
```
#### Properties
| Props | Type | Required | Values | Default | Description |
| ------------------ | -------- | :------: | --------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `fontSize` | `number` | - | - | `13` | Sets the font size |
2019-08-06 14:31:52 +00:00
| `as` | `string` | - | - | `p` | 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 |
| `color` | `string` | - | - | `#333333` | Specifies the text color |
| `isBold` | `bool` | - | - | false | Sets font weight value to bold |
2019-07-02 11:22:48 +00:00
| `isItalic` | `bool` | - | - | false | Sets the font style |
| `backgroundColor` | `string` | - | - | - | Sets background color |
| `fontWeight` | `number` | - | - | - | Sets the font weight |
2019-07-02 11:22:48 +00:00