openedx / paragon

💎 An accessible, theme-ready design system built for learning applications and Open edX.

Home Page:https://paragon-openedx.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Truncate` component relies on `elementType` instead of `as` (props API inconsistency)

adamstankiewicz opened this issue · comments

Improvements

Any component that allows consumers to override its underlying DOM element (e.g., div, span) should rely on an as prop for consistency with the majority of Paragon components (given most rely on react-bootstrap).

The Truncate component uses an elementType component instead of as. At least one engineer assumed as prop would work, and had to rely on the documentation to learner that Truncate uses elementType instead.

Given one of the goals of Paragon is to provide a reasonably consistent props API across components, we should ensure that any component that allows consumers to override its underlying DOM element relies on an as prop.

Tasks