How to use the @fluentui/react-proptypes.align function in @fluentui/react-proptypes

To help you get started, we’ve selected a few @fluentui/react-proptypes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / fluent-ui-react / packages / react / src / components / Text / Text.tsx View on Github external
static className = 'ui-text'

  static displayName = 'Text'

  static propTypes = {
    ...commonPropTypes.createCommon({ color: true }),
    atMention: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['me'])]),
    disabled: PropTypes.bool,
    error: PropTypes.bool,
    important: PropTypes.bool,
    size: customPropTypes.size,
    weight: PropTypes.oneOf(['light', 'semilight', 'regular', 'semibold', 'bold']),
    success: PropTypes.bool,
    temporary: PropTypes.bool,
    align: customPropTypes.align,
    timestamp: PropTypes.bool,
    truncated: PropTypes.bool,
  }

  static defaultProps = {
    as: 'span',
  }

  renderComponent({ accessibility, ElementType, classes, unhandledProps }): React.ReactNode {
    const { children, content } = this.props

    return (
github microsoft / fluent-ui-react / packages / react / src / components / Header / Header.tsx View on Github external
class Header extends UIComponent, any> {
  static displayName = 'Header'

  static className = 'ui-header'

  static slotClassNames: HeaderSlotClassNames = {
    description: `${Header.className}__description`,
  }

  static create: ShorthandFactory

  static propTypes = {
    ...commonPropTypes.createCommon({ color: true }),
    description: customPropTypes.itemShorthand,
    align: customPropTypes.align,
    rtlAttributes: PropTypes.func,
  }

  static defaultProps = {
    as: 'h1',
  }

  static Description = HeaderDescription

  renderComponent({ accessibility, ElementType, classes, variables: v, unhandledProps }) {
    const { children, description, content } = this.props

    const hasChildren = childrenExist(children)
    const contentElement = childrenExist(children) ? children : content

    return (