Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Proposal: Fieldset component #20230

Open
1 task done
csandanov opened this issue Dec 13, 2019 · 3 comments
Open
1 task done

[4.0] Proposal: Fieldset component #20230

csandanov opened this issue Dec 13, 2019 · 3 comments

Comments

@csandanov
Copy link

csandanov commented Dec 13, 2019

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

There's a standard HTML tag <fieldset> which is used to visually group form elements, see example. It would be great if antd had <Fieldset> with a standard antd styling and may some configuration like title and border style.

What does the proposed API look like?

Example: https://codesandbox.io/s/antd-reproduction-template-4924q
This example uses standard <fieldset> with <legend>, imagine if we had something like:

<Fieldset title="" fullBorder titlePosition="right">
@afc163
Copy link
Member

afc163 commented Mar 18, 2020

@csandanov
Copy link
Author

Divider adds spaces but I need a visual grouping of elements

@abenhamdine
Copy link
Contributor

abenhamdine commented Nov 1, 2020

FWIW we use this simple in-house component which meets our needs :

import * as React from 'react'
import './styles.css'

interface Props {
    children: React.ReactNode
    title: string
    style?: React.CSSProperties
}

export const ArhFieldset: React.FC<Props> = ({ children, title, style }) =>
    <fieldset className="arh-fieldset" style={style}>
        <legend>{title}</legend>
        {children}
    </fieldset>

@afc163 afc163 added ☘️ New Component and removed 4.x In Ant Design 4.0 labels Jun 24, 2022
@afc163 afc163 removed their assignment Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants