[joy-ui][Card] Make orientation Responsive
@siriwatknp is already working on this.
Since Feb 5, 2024.
- Dominant language
- JavaScript
- Stars
- 99.1k
- Forks
- 32.5k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 106
Description
Summary
I ended up in a situation where doing this:
<Card orientation={{xs: "vertical", md: "horizontal"}}>
<NarrowContent/>
<Divider />
<WideContent/>
</Card>
would achieve result I want, that's about it.
Whilst writing this I thought that I would do it like I used to with useMediaQuery but turns out it's not in joy - https://github.com/mui/material-ui/issues/35037, so I guess I'll copy-paste content and display-hide/block it for now.
update: tried to extract content into it's own <MyCardContent/>:
<Card orientation="horizontal" sx={{ display: { xs: "none", md: "flex" } }}>
<MyCardContent />
</Card>
<Card orientation="vertical" sx={{ display: { xs: "flex", md: "none" } }}>
<MyCardContent />
</Card>
and that kinda failed because <Divider/> stopped behaving because it's no longer a direct child of Card, I'm kind of at a loss what to do.
Examples
No response
Motivation
No response
Search keywords: joy card orientation vertical horizontal responsive mobile desktop
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.