Skip to main content

Edit Basic Information Block

EditBasicInformation is a controlled address-and-profile form block built on MUI.

Installation​

npm install @nodeblocks/frontend-edit-basic-information-block

What You Need​

ItemWhy it matters
dataControlled form state. The default shape uses NameInput, FuriganaInput, PostalCodeInput, PrefectureSelect, CityInput, AddressInput, and PhoneInput.
onDataChangeReceives the next data snapshot plus metadata about the edited field path.
errors (optional)Field-level validation feedback keyed by field path.
labels (optional)Copy for the title, subtitle, input labels, search button, and submit button.
placeholders (optional)Placeholder text for text inputs and the prefecture select.
selectOptions (optional)Custom option list for the prefecture select.
onSearchAddressClick (optional)Handles the postal-code address lookup button.
blockSpacingBefore (optional)Adjusts spacing before specific default blocks or override blocks.
children (optional)Use compound components or block override rendering.
Controlled component

EditBasicInformation does not own form state. Keep data in your app and pass updates back through onDataChange. The stock shape is the named-field object used in Storybook, and FieldErrorMap uses bracket-notation paths if you need nested validation later.

Code Examples​

Live Editor
function Example() {
  const defaultData = {
    NameInput: '汱田ć€Ș郎',
    FuriganaInput: 'ăƒ€ăƒžăƒ€ă‚żăƒ­ă‚Š',
    PostalCodeInput: '1234567',
    PrefectureSelect: '東äșŹéƒœ',
    CityInput: '澂ćŒșç”șæ‘ă‚’ć…„ćŠ›',
    AddressInput: 'ç”șćăƒ»ç•Șćœ°ăƒ»ć»ș物を慄抛',
    PhoneInput: '電話ç•Șć·ă‚’ć…„ćŠ›ïŒˆăƒă‚€ăƒ•ăƒłăȘă—ă§ć…„ćŠ›ïŒ‰',
  };

  const [data, setData] = React.useState(defaultData);

  return (
    <EditBasicInformation
      data={data}
      onDataChange={(nextData) => {
        setData(nextData);
      }}
      onSearchAddressClick={() => {
        setData((current) => ({ ...current }));
      }}
    />
  );
}
Result
Loading...

Important Props​

Core Props​

PropTypeRequiredDefaultDescription
dataEditBasicInformationFormDataYes-Controlled form state. The default story shape uses the named fields listed above.
onDataChange(data: EditBasicInformationFormData, meta: { name: string; value: unknown; cause: one of input, change, blur, clear, reset, programmatic; event?: React.SyntheticEvent }) => voidYes-Called whenever a field updates. meta.name uses bracket-notation paths.
errors{ [fieldPath: string]: string | string[] }NoundefinedValidation feedback keyed by field path.
onSearchAddressClickMouseEventHandler<HTMLButtonElement>NoundefinedShown as the postal-code search action when provided.

Content Props​

PropTypeRequiredDefaultDescription
labels{ title?: string; subtitle?: string; nameInput?: string; furiganaInput?: string; postalCodeInput?: string; searchAddressButton?: string; prefectureSelect?: string; cityInput?: string; addressInput?: string; phoneInput?: string; submitButton?: string }NoundefinedCopy for the title, helper text, input labels, search button, and submit button.
placeholders{ nameInput?: string; furiganaInput?: string; postalCodeInput?: string; prefectureSelect?: string; cityInput?: string; addressInput?: string; phoneInput?: string }NoundefinedPlaceholder copy for the text fields and prefecture select.
selectOptions{ prefectureSelect?: { value: string; label: string }[] }NoundefinedCustom options for the prefecture select.

Layout and Composition Props​

PropTypeRequiredDefaultDescription
componentStackProps<'form'>['component']No'form'Root element rendered by the outer stack.
blockSpacingBeforePartial<Record<string, number | Partial<Record<'xs' | 'sm' | 'md' | 'lg' | 'xl', number>>>>No{ subtitle: 4, nameInput: { xs: 4, sm: 3 }, submitButton: 4 }Extra spacing before named default blocks or function-based override blocks.
childrenBlocksOverride<typeof defaultBlocks, CustomBlocks>NoundefinedUse JSX compound components or a function that returns blocks and blockOrder.

Inherited props come from StackProps<'form'> with children replaced by the block override API, so standard form/container props such as className, sx, and id are available.

Default UI Blocks​

BlockBuilt onNotes
EditBasicInformationStackRoot form shell with padding and responsive layout.
TitleTypographyvariant="h4", component="h2", bold and centered. Defaults to ćŸșæœŹæƒ…ć ±ă‚’ç·šé›†.
SubtitleTypographyvariant="body2". Defaults to * は濅須äș‹é …です.
NameInputTextFieldDefaults to label æ°ć and placeholder æ°ćă‚’ć…„ćŠ›.
FuriganaInputTextFieldDefaults to label フăƒȘガナ and placeholder フăƒȘă‚ŹăƒŠă‚’ć…„ćŠ›.
PostalCodeInputTextField + ButtonDefaults to label éƒ”äŸżç•Șć·, placeholder éƒ”äŸżç•Șć·ă‚’ć…„ćŠ›, and search button äœæ‰€ă‚’æ€œçŽą.
PrefectureSelectFormControl + InputLabel + SelectDefaults to label 郜道ćșœçœŒ, placeholder 郜道ćșœçœŒă‚’遞択, and built-in prefecture options.
CityInputTextFieldDefaults to label 澂ćŒșç”ș村 and placeholder 澂ćŒșç”șæ‘ă‚’ć…„ćŠ›.
AddressInputTextFieldDefaults to label ç”șćăƒ»ç•Șćœ°ăƒ»ć»ș物 and placeholder ç”șćăƒ»ç•Șćœ°ăƒ»ć»ș物を慄抛.
PhoneInputTextFieldDefaults to label é€Łç”Ąć…ˆé›»è©±ç•Șć· and placeholder 電話ç•Șć·ă‚’ć…„ćŠ›ïŒˆăƒă‚€ăƒ•ăƒłăȘă—ă§ć…„ćŠ›ïŒ‰.
SubmitButtonButtonvariant="contained", size="large", type="submit", centered with a wide desktop width. Defaults to 保歘.

Extra field primitives​

PrimitiveMain PropsInheritsBuilt onNotes
Inputname, label, placeholder, requiredTextFieldProps plus getValue, setValue, and errors from contextTextFieldA controlled text field primitive used by the stock layout. Available for custom flows, but not rendered directly in the default block order.

TypeScript​

type EditBasicInformationFormData =
| {
NameInput: string;
FuriganaInput: string;
PostalCodeInput: string;
PrefectureSelect: string;
CityInput: string;
AddressInput: string;
PhoneInput: string;
}
| Record<string, unknown>;