Popovers normal form #1284
Replies: 5 comments 8 replies
-
In the reduced format, what would be the format of the trigger? Would it always be a primary button with the label? Would it vary for each component? Specially for the tooltip we usually use a custom icon currently |
Beta Was this translation helpful? Give feedback.
-
What is the need for a store on these advanced use cases? Can you provide an example? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
LGTM ✨ Just a question, Is there any risk of the spread causing an unexpected override here? <Combobox {...(inputProps + providerProps + popoverProps)}> |
Beta Was this translation helpful? Give feedback.
-
Implemented by #1422. Notice that primitives do not need the compact version. |
Beta Was this translation helpful? Give feedback.
-
Context
The normal form describes a consistent API template for all popovers. The main objective is to reduce the Shoreline Library learning curve by reusing latent developer knowledge.
There are two forms of popover components. Full form, and reduced form.
The main reason for both forms to exist is to provide our users with optimal experience in common use cases, without removing the library flexibility for diverse cases.
Let's take the Menu, for example. The Full form consists of:
Example: Menu
By default, all popover components are uncontrolled. The user can take control of it by passing a state:
For advanced use cases, stores are also allowed.
The reduced form merges Provider, Trigger, and Popover into a single component. The children of the Trigger, becomes the
label
prop:It also accepts all props of the Provider:
API Preview
Popover
Reduced form:
Select
Reduced form:
Menu
Reduced form:
Filter
Reduced form:
Tooltip
Reduced form:
Edge Case: Combobox
It will follow the same pattern, but changes
Trigger
forInput
. On the Full form:Reduced form:
Decisions
Trigger vs Disclosure vs Anchor
Trigger
was chosen because is easier to write thanDisclosure
and is more meaningful thanAnchor
.Provider vs Root
Provider
was chosen overRoot
because is more meaningful.Item vs Option
Item
covers more cases thanOption
.Beta Was this translation helpful? Give feedback.
All reactions