Semantic-Org/Semantic-UI-React

Advertise all underlying propTypes and typings in wrapper components

Open

#1,169 opened on Jan 16, 2017

View on GitHub
 (20 comments) (0 reactions) (0 assignees)JavaScript (4,065 forks)batch import
docsgood first issuehelp wanted

Repository metrics

Stars
 (13,136 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

See #1163 for the inspiration here.

Some components wrap others, like a Popup wrapping a Portal. However, we do not advertise the Portal props as propTypes nor typings of the Popup. This means there is no way for users to know what props are available.

Add propTypes

I propose we explicitly list all known props in propTypes and typings of the underlying component when a component wraps another component.

Add Examples

We should then also add doc site examples showing use of these props. Example, Popup mouse enter/leave delays are not shown but are available as it composes the Portal which has mouse enter/leave delays.

Task List

Here is a brain dump of wrapper components, there may be more. @jcarbo / @layershifter feel free to update this list at will:

  • Popup -> Portal
  • Modal -> Portal
  • Confirm -> Modal
  • Select -> Dropdown
  • Radio -> Checkbox
  • Table.Footer -> Table.Header
  • Table.HeaderCell -> Table.Cell
  • Form.Button -> FormField + Button
  • Form.Checkbox -> FormField + Checkbox
  • Form.Dropdown -> FormField + Dropdown
  • Form.Input -> FormField + Input
  • Form.Radio -> FormField + Radio
  • Form.Select -> FormField + Select
  • Form.TextArea -> FormField + TextArea

Contributor guide