Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom wrapper components in Phrase, Text #18

Open
kumar303 opened this issue Sep 13, 2020 · 1 comment
Open

Allow custom wrapper components in Phrase, Text #18

kumar303 opened this issue Sep 13, 2020 · 1 comment

Comments

@kumar303
Copy link
Owner

This is currently how you'd work with Phrase and Text in a layout:

import { Phrase, SkeletonGroup, Text } from 'skeleton-kit';

<div>
  <SkeletonGroup showSkeletons={!isLoaded}>
    <Heading><Phrase>{data.title}</Phrase></Heading>
    <p><Text>{data.description}</Text></p>
  </SkeletonGroup>
</div>

Maybe it would be easier to support a new as prop for this:

import { Phrase, SkeletonGroup, Text } from 'skeleton-kit';

<div>
  <SkeletonGroup showSkeletons={!isLoaded}>
    <Phrase as={Heading}>{data.title}</Phrase>
    <Text as="p">{data.description}</Text>
  </SkeletonGroup>
</div>
@kumar303
Copy link
Owner Author

Non-goal: we don't need to go overboard and support a custom wrapper component with custom props.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant