Skip to content

RegionSelect

Where data lives: each region with its city and code. The choice usually cannot change later, so say it in the hint.

import { RegionSelect } from '@sypnia/ui/react'

On this page
  1. A project's region
  2. When to use it
  3. For everyone
  4. Props

A project's region

Choose the one closest to your users. It cannot be changed later.

Code
import { useState } from 'react';
import { Field, RegionSelect } from '@sypnia/ui/react';

// Where the data lives. It cannot change later, so the hint says so.
export default function Where() {
  const [r, setR] = useState('eu-central-1');
  return <Field label="Region" hint="Choose the one closest to your users. It cannot be changed later."><RegionSelect value={r} onChange={setR} regions={[
    { id: 'us-east-1', name: 'Virginia', location: 'United States' }, { id: 'eu-central-1', name: 'Frankfurt', location: 'Germany' }, { id: 'sa-east-1', name: 'São Paulo', location: 'Brazil' },
  ]} /></Field>;
}

When to use it

Use it when

  • Creating a project, a bucket, a database.

Do not use it when

  • Countries of people: use a country list.

For everyone

  • It is a select; the city and code are read with each option.

Props

RegionSelectTypeDefault
regionsrequired Region[]
aria-describedby string
aria-label

The name for screen readers when there is no Field around it.

string
aria-labelledby string
className string
disabled boolean
id

Inside a Field it comes from the Field.

string
name string
onChange ((id: string) => void)
value string
  1. A project&#39;s region
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms