Comments (4)
👋 @stefankp - thanks for bringing this up.
We'll need to discuss this in detail at our next maintainer sync to find the right solution going forward, but in the meantime here are my immediate thoughts..
<Component heading="..." />
We will occasionally use this prop based API where we want - or sometimes need - to restrict the appearance and implementation of the prop through an abstraction. While I agree it's not composable API like we offer elsewhere, the tradeoff here is that it's faster to implement and render while achieving our intended guardrails.
<Component>
<Heading>...</Heading>
</Component>
<Component>
<Component.Heading>...</Component.Heading>
</Component>
Definitely agree the differences aren't immediately clear 😅. The context here, is that namespaced versions do a lot more under the hood than non-namespaced equivalents. It's also meant to indicate that the entire API for Heading is available to you on the former. Component.Heading
however, could have an entirely different API and is not necessarily equivalent to Heading
. We always try to go with the former first, but when there's too many defaults required, we end up namespacing.
This API suggests to me that I could pass in more than one component (or other), but actually only the first one is accepted.
This either should be documented or fixed so that we batch the rendering of multiple Text
child types. I think this is an easy one to fix, we can take this away.
Hero
Just an FYI that the Hero component will be refactored eventually... here a related issue.
from brand.
@rezrah I think we should prefer the composable APIs when possible. Exception could be when a component only has required inputs with no optional customization. Looking forward to the Hero refactor 👌
from brand.
Closing this issue as..
- A revised hero has now shipped with a composable API
- We'll be writing up the ADR in contributor documentation in Q1
- Nuances around filtering of
children
on certain components will be captured and explained in their respective documentation. - We already have established precedent for writing composable component API's, which is being used in all net new components.
from brand.
Next steps:
- Await feedback from @stefankp et al
- Document API conventions and rationales in an ADR
from brand.
Related Issues (20)
- 🐛 [BUG] - InlineLink does not inherit size HOT 7
- [Feature request] Add support for multiple `AnchorNav.Action` HOT 3
- 🐛 [BUG] - `Prose`'s unordered lists do not play well with dark mode
- [Suggestion]: Add documentation around Stack breakpoints
- 🐛 [BUG] - Regression of `leadingVisual` on `TextInput` HOT 1
- 🐛 [BUG] - Button Gap on Medium Size should be 4px (0.25rem) instead of 12px. HOT 5
- [Feature request] Allow `<Label>` in River + Bentos HOT 1
- 🐛 [BUG] - `padding-inline-start` does not set in Timeline.Item component HOT 2
- [Accessibility] `SubdomainNavBar` misses controls when narrow HOT 3
- [Accessibility] `FAQ.Item` is not getting closed using 'ESC' key
- [Contentful] Add Possibility of Content Block (Rich Text) Modules HOT 2
- 🐛 [BUG] - `Testimonial`: insufficient contrast for default quote symbol in dark mode HOT 1
- [Suggestion] Enhance the `Heading` component to support new `text-wrap` values HOT 3
- [Feature request] Allow custom icon in `UnorderedList.Item` HOT 1
- 🐛 [BUG] - `className` is missing on `<Hero.Description>`
- [Suggestion] Update the example for the `ActionMenu`
- 🐛 [BUG] - Action menu overlay for adding language dropdown HOT 1
- [Feature request] Support smaller Bento icon size HOT 1
- [Accessibility] No error state or error description in Forms HOT 1
- Increase height of snapshots
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brand.