Example: User Profile with Tabs

User profile form with tabs and cards.

{
    "schema": {
        "type": "object",
        "properties": {
            "name": {
                "type": "string",
                "title": "Name",
                "description": "User's real name."
            },
            "username": {
                "type": "string",
                "title": "Username",
                "description": "Username. Can be used to login."
            },
            "email": {
                "type": "string",
                "format": "email",
                "title": "Email",
                "description": "Email address for system use, including login and notifications."
            },
            "api_hash": {
                "type": "string",
                "title": "API hash",
                "description": "User's unique identifier in the API. To generate a new one, delete this and save."
            },
            "api_key": {
                "type": "string",
                "title": "API key",
                "description": "Send authentication header to the API: Authorization: Basic APIKEY"
            },
            "current_password": {
                "type": "string",
                "title": "Current password",
                "description": "Password currently used by the user."
            },
            "new_password": {
                "type": "string",
                "title": "New password",
                "description": "Password you want to use."
            },
            "repeat_password": {
                "type": "string",
                "title": "Repeat password",
                "description": "Repeat the password entered above."
            }
        },
        "required": [
            "name",
            "username",
            "email"
        ]
    },
    "uischema": {
        "type": "Categorization",
        "elements": [
            {
                "type": "Category",
                "label": "Basic Information & API Access",
                "elements": [
                    {
                        "type": "Group",
                        "label": "Basic Information",
                        "elements": [
                            {
                                "type": "Control",
                                "scope": "#/properties/name"
                            },
                            {
                                "type": "Control",
                                "scope": "#/properties/username"
                            },
                            {
                                "type": "Control",
                                "scope": "#/properties/email"
                            }
                        ]
                    },
                    {
                        "type": "Group",
                        "label": "API Access",
                        "elements": [
                            {
                                "type": "Control",
                                "scope": "#/properties/api_hash",
                                "options": {
                                    "format": "password",
                                    "showUnfocusedDescription": true
                                }
                            },
                            {
                                "type": "Control",
                                "scope": "#/properties/api_key",
                                "options": {
                                    "format": "password",
                                    "showUnfocusedDescription": true
                                }
                            }
                        ]
                    }
                ]
            },
            {
                "type": "Category",
                "label": "Password",
                "elements": [
                    {
                        "type": "Group",
                        "label": "Change Password",
                        "elements": [
                            {
                                "type": "Control",
                                "scope": "#/properties/current_password",
                                "options": {
                                    "format": "password"
                                }
                            },
                            {
                                "type": "Control",
                                "scope": "#/properties/new_password",
                                "options": {
                                    "format": "password"
                                }
                            },
                            {
                                "type": "Control",
                                "scope": "#/properties/repeat_password",
                                "options": {
                                    "format": "password"
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "data": {
        "name": "Admin",
        "username": "admin",
        "email": "[email protected]",
        "api_hash": "uhkCY2ymkklJ24SDkyPdnmkT6RcUiOac",
        "api_key": "QmFzaWMgWDp1aGtDWTJ5bWtrbEoyNFNEa3lQZG5ta1Q2UmNVaU9hYw=="
    }
}
Basic Information
User's real name.
Username. Can be used to login.
Email address for system use, including login and notifications.
API Access
User's unique identifier in the API. To generate a new one, delete this and save.
Send authentication header to the API: Authorization: Basic APIKEY
Change Password
Password currently used by the user.
Password you want to use.
Repeat the password entered above.
{
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "title": "Name",
            "description": "User's real name."
        },
        "username": {
            "type": "string",
            "title": "Username",
            "description": "Username. Can be used to login."
        },
        "email": {
            "type": "string",
            "title": "Email",
            "description": "Email address for system use, including login and notifications.",
            "format": "email"
        },
        "api_hash": {
            "type": "string",
            "title": "API hash",
            "description": "User's unique identifier in the API. To generate a new one, delete this and save."
        },
        "api_key": {
            "type": "string",
            "title": "API key",
            "description": "Send authentication header to the API: Authorization: Basic APIKEY"
        },
        "current_password": {
            "type": "string",
            "title": "Current password",
            "description": "Password currently used by the user."
        },
        "new_password": {
            "type": "string",
            "title": "New password",
            "description": "Password you want to use."
        },
        "repeat_password": {
            "type": "string",
            "title": "Repeat password",
            "description": "Repeat the password entered above."
        }
    },
    "required": [
        "name",
        "username",
        "email"
    ]
}
{
    "type": "Categorization",
    "elements": [
        {
            "type": "Category",
            "label": "Basic Information & API Access",
            "elements": [
                {
                    "type": "Group",
                    "label": "Basic Information",
                    "elements": [
                        {
                            "type": "Control",
                            "scope": "#/properties/name"
                        },
                        {
                            "type": "Control",
                            "scope": "#/properties/username"
                        },
                        {
                            "type": "Control",
                            "scope": "#/properties/email"
                        }
                    ]
                },
                {
                    "type": "Group",
                    "label": "API Access",
                    "elements": [
                        {
                            "type": "Control",
                            "scope": "#/properties/api_hash",
                            "options": {
                                "format": "password",
                                "showUnfocusedDescription": true
                            }
                        },
                        {
                            "type": "Control",
                            "scope": "#/properties/api_key",
                            "options": {
                                "format": "password",
                                "showUnfocusedDescription": true
                            }
                        }
                    ]
                }
            ]
        },
        {
            "type": "Category",
            "label": "Password",
            "elements": [
                {
                    "type": "Group",
                    "label": "Change Password",
                    "elements": [
                        {
                            "type": "Control",
                            "scope": "#/properties/current_password",
                            "options": {
                                "format": "password"
                            }
                        },
                        {
                            "type": "Control",
                            "scope": "#/properties/new_password",
                            "options": {
                                "format": "password"
                            }
                        },
                        {
                            "type": "Control",
                            "scope": "#/properties/repeat_password",
                            "options": {
                                "format": "password"
                            }
                        }
                    ]
                }
            ]
        }
    ],
    "options": []
}
{
    "name": "Admin",
    "username": "admin",
    "email": "[email protected]",
    "api_hash": "uhkCY2ymkklJ24SDkyPdnmkT6RcUiOac",
    "api_key": "QmFzaWMgWDp1aGtDWTJ5bWtrbEoyNFNEa3lQZG5ta1Q2UmNVaU9hYw=="
}

Tags: #withSchema #withUiSchema #withData #categories #groups #description
006_profile_tabs