Skip to content

Commit

Permalink
feat(FormItem): Add noPaddings prop to allow to disable paddings (#5600)
Browse files Browse the repository at this point in the history
  • Loading branch information
mendrew authored Aug 11, 2023
1 parent 38ae149 commit fdf9a83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vkui/src/components/FormItem/FormItem.module.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.FormItem {
display: block;
}

.FormItem--withPadding {
padding: var(--vkui--size_form_item_padding_vertical--regular)
var(--vkui--size_base_padding_horizontal--regular);
}
Expand Down
7 changes: 7 additions & 0 deletions packages/vkui/src/components/FormItem/FormItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ export interface FormItemProps
* Режим `indent` предназначен для визуального отступа
*/
removable?: boolean | 'indent';
/**
* Удаляет внешние отступы вокруг компонента
* @since 5.8.0
*/
noPadding?: boolean;
}

/**
Expand All @@ -55,6 +60,7 @@ export const FormItem = ({
className,
htmlFor,
bottomId,
noPadding,
...restProps
}: FormItemProps) => {
const rootEl = useExternRef(getRootRef);
Expand Down Expand Up @@ -90,6 +96,7 @@ export const FormItem = ({
ref={rootEl}
className={classNames(
styles['FormItem'],
!noPadding && styles['FormItem--withPadding'],
'vkuiInternalFormItem',
status !== 'default' &&
{
Expand Down

0 comments on commit fdf9a83

Please sign in to comment.