histoire-dev / histoire-dev/histoire

A way to specify the root element for the dynamic source

Open
#604 2 comments 1 reaction 0 assignees View on GitHub
enhancement: to triage
Dominant language
TypeScript
Stars
3.6k
Forks
212
PR merge metrics
No merged PRs in 30d

Description

### Clear and concise description of the problem

Often I need a wrapper component for a `Variant` - sometimes that's to set up mock stores, sometimes it's because the child component is absolutely positioned (or has negative margin/padding) and so the parent needs to offset the child appropriately.

However, adding a wrapper component makes the wrapper component show up in the dynamic source

### Suggested solution

An attribute that can be placed on any element, to make it the root of the dynamic source.

### Alternative

_No response_

### Additional context

_No response_

### Validations

- [X] Follow our [Code of Conduct](https://github.com/histoire-dev/histoire/blob/main/CODE_OF_CONDUCT.md)
- [X] Read the [Contributing Guidelines](https://github.com/histoire-dev/histoire/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://histoire.dev/guide/).
- [X] Check that there isn't [already an issue](https://github.com/histoire-dev/histoire/issues) that requests the same feature to avoid creating a duplicate.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.