posthog
posthog copied to clipboard
feat: LemonLabel / Improved Field
Problem
Design System work for improved Labels, and therefor improved Field component (mixture of label, input and error messages)
Changes
- Adds a new
LemonLabel
to be used wherever aField
is not possible - Refactors
Field
to have a "Pure" version for simple rendering and a standard version for use with kea - no more antd styles. No more annoying overrides - Removes VerticalForm as all fields are now vertical.
(See deployed Storybook for more but here is a screenshot)

👉 Stay up-to-date with PostHog coding conventions for a smoother review.
How did you test this code?
Looks good. The one thing I see is the optional label. Those are most often using the secondary text color and should use sentence case (lowercase o). 👍
Good catch. Im actually wondering about keeping the property "optional" as a Boolean which prefills the label with this content. Seems to be the most commonly used use case for it so may as well standardise it. Would still have the escape hatch of using the component style label if there was a different need.
Good catch. Im actually wondering about keeping the property "optional" as a Boolean which prefills the label with this content. Seems to be the most commonly used use case for it so may as well standardise it. Would still have the escape hatch of using the component style label if there was a different need.
Sounds like a good plan. The optional piece is really the only variation I know of for form labels. Sometimes they have icons to hang tooltips from, but it's rare.