DocSpace-buildtools/web/ASC.Web.Components/src/components/text
2019-12-09 18:33:05 +03:00
..
common-text-styles.js web.components: Text: refactoring, separating component to 3 components, apply changes 2019-12-04 12:36:13 +03:00
index.js web.components: Text: prop size can be string or number 2019-12-09 18:33:05 +03:00
README.md web.components: Text: prop size can be string or number 2019-12-09 18:33:05 +03:00
text.stories.js web.components: Text: refactoring, separating component to 3 components, apply changes 2019-12-04 12:36:13 +03:00
text.test.js web.components: Text: refactoring, separating component to 3 components, apply changes 2019-12-04 12:36:13 +03:00

Text

Component that displays plain text

Usage

import { Text } from "asc-web-components";
<Text as="p" title="Some title">
  Some text
</Text>

If you need to override styles add forwardedAs instead of as

const StyledText = styled(Text)`
  &:hover {
    border-bottom: 1px dotted;
  }
`;
<StyledText forwardedAs="span" title="Some title">
  Some text
</StyledText>

Properties

Props Type Required Values Default Description
fontSize oneOfType(number, string) - - 13 Sets the font size
as string - - p Sets the tag through which to render the component
title bool - - - Title
truncate bool - - false Disables word wrapping
isInline bool - - false Sets the 'display: inline-block' property
display string - - - Sets the 'display' property
color string - - #333333 Specifies the text color
isBold bool - - false Sets font weight value to bold
isItalic bool - - false Sets the font style
backgroundColor string - - - Sets background color
fontWeight number - - - Sets the font weight