All Projects → aws-amplify → amplify-codegen-ui

aws-amplify / amplify-codegen-ui

Licence: other
Generate React components for use in an AWS Amplify project.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to amplify-codegen-ui

amplify-nuxt
Video series code for how to setup AWS Amplify with a Nuxt project
Stars: ✭ 27 (+92.86%)
Mutual labels:  amplify, aws-amplify
graphql-ttl-transformer
♻ Enable DynamoDB's time-to-live feature to auto-delete old entries in your AWS Amplify API!
Stars: ✭ 75 (+435.71%)
Mutual labels:  amplify, aws-amplify
cognito-amplify-custom-auth
A React/Redux web application that implements a custom UI for Cognito Userpool Auth using AWS Amplify
Stars: ✭ 27 (+92.86%)
Mutual labels:  amplify, aws-amplify
amplify-ui
A multi-framework Design System to provide a solid foundation for building UI!
Stars: ✭ 487 (+3378.57%)
Mutual labels:  amplify
react-admin-amplify
AWS Amplify data provider for react-admin.
Stars: ✭ 130 (+828.57%)
Mutual labels:  aws-amplify
aws-amplify-react-custom-ui
Building a Custom UI Authentication For AWS Amplify
Stars: ✭ 21 (+50%)
Mutual labels:  aws-amplify
titanium-turbo
Axway Amplify module that adds some enhancements for Appcelerator Titanium Alloy
Stars: ✭ 15 (+7.14%)
Mutual labels:  amplify
voterocket-lab
AWS Summit Dev Labs: Build a modern serverless web application in minutes using the AWS Amplify Framework
Stars: ✭ 23 (+64.29%)
Mutual labels:  amplify
aws-serverless-fullstack-swift-apple-carplay-example
This application demonstrates a full-stack Apple CarPlay app that uses Swift for both the UI and the backend services in AWS. The app accesses Lambda functions written in Swift and deployed from Docker images. The app accesses Amazon Location Service and a 3rd party weather api to display information in the vicinity of the user.
Stars: ✭ 84 (+500%)
Mutual labels:  amplify
serverless-web-app-example
Serverless React Web App Example
Stars: ✭ 41 (+192.86%)
Mutual labels:  aws-amplify
basic-serverless-api
A basic full stack example of building an API with AWS Amplify, Amazon API Gateway, AWS Lambda, and Amazon DynamoDB
Stars: ✭ 45 (+221.43%)
Mutual labels:  aws-amplify
amplify-material-ui
A Material-UI based implementation of aws amplify
Stars: ✭ 32 (+128.57%)
Mutual labels:  amplify
study-amplify-with-react-native
AWSKRUG Community Day 2020 Amplify Keynote and Demo
Stars: ✭ 15 (+7.14%)
Mutual labels:  amplify
clojurescript-amplified
Examples on how to setup a ClojureScript web app with tools from the JavaScript ecosystem.
Stars: ✭ 59 (+321.43%)
Mutual labels:  aws-amplify
aws-cognito-next
Authentication helpers for AWS Cognito in next.js
Stars: ✭ 64 (+357.14%)
Mutual labels:  aws-amplify
enjoytheshow
Real-time facial expression gathering
Stars: ✭ 32 (+128.57%)
Mutual labels:  amplify
aws-sync-routes
Synchronizes the specified route from the main/default route table to all custom route tables in the VPC.
Stars: ✭ 16 (+14.29%)
Mutual labels:  aws-amplify
transform-graphql
⚙️ Transformer function to transform GraphQL Directives. Create model CRUD directive for example
Stars: ✭ 23 (+64.29%)
Mutual labels:  amplify
aws-amplify-sns-workshop-in-vscode
VSCode remote-containers environment for "Amplify SNS Workshop"
Stars: ✭ 27 (+92.86%)
Mutual labels:  aws-amplify
react-native-custom-authentication
Custom authentication flow using React Native and AWS Amplify
Stars: ✭ 27 (+92.86%)
Mutual labels:  aws-amplify

AWS Amplify


Amplify Codegen UI

GitHub Discord Build CircleCI Language grade: JavaScript codecov Open Bugs Feature Requests

Generate React components for use in an AWS Amplify project.

Usage

Amplify Codegen UI supports component generation in Node or a browser environment.

Generate in Node

Components

import {
  AmplifyRenderer,
  StudioTemplateRendererFactory,
  StudioTemplateRendererManager,
} from '@aws-amplify/codegen-ui-react';

const renderConfig = {};
const outputConfig = {
  outputPathDir: './src/ui-components';
};

const componentRendererFactory = new StudioTemplateRendererFactory(
  (component) => new AmplifyRenderer(component, renderConfig),
);

const rendererManager = new StudioTemplateRendererManager(componentRendererFactory, outputConfig);

const component = {
  id: '1234-5678-9010',
  componentType: 'Text',
  name: 'TextPrimitive',
  properties: {
    label: {
      value: 'Hello world',
    },
  },
};

rendererManager.renderSchemaToTemplate(component);

Themes

import {
  ReactThemeStudioTemplateRenderer,
  StudioTemplateRendererFactory,
  StudioTemplateRendererManager,
} from '@aws-amplify/codegen-ui-react';

const renderConfig = {};
const outputConfig = {
  outputPathDir: './src/ui-components';
};

const themeRendererFactory = new StudioTemplateRendererFactory(
  (theme) => new ReactThemeStudioTemplateRenderer(theme, renderConfig),
);

const themeRendererManager = new StudioTemplateRendererManager(themeRendererFactory, outputConfig);

const theme = {
  id: '1234-5678-9010',
  name: 'MyTheme',
  values: [
    {
      key: 'tokens',
      value: {
        children: [
          {
            key: 'colors',
            value: {
              children: [
                {
                  key: 'font',
                  value: {
                    children: [
                      {
                        key: 'primary',
                        value: {
                          children: [
                            {
                              key: 'value',
                              value: {
                                value: '#008080',
                              },
                            },
                          ],
                        },
                      },
                    ],
                  },
                },
              ],
            },
          },
        ],
      },
    },
  ],
};

themeRendererManager.renderSchemaToTemplate(theme);

index.js File

import {
  ReactIndexStudioTemplateRenderer,
  StudioTemplateRendererFactory,
  StudioTemplateRendererManager,
} from '@aws-amplify/codegen-ui-react';

const renderConfig = {};
const outputConfig = {
  outputPathDir: './src/ui-components',
};

const indexRendererFactory = new StudioTemplateRendererFactory(
  (components) => new ReactIndexStudioTemplateRenderer(components, renderConfig),
);

const indexRendererManager = new StudioTemplateRendererManager(indexRendererFactory, outputConfig);

const components = [
  {
    id: '1234-5678-9010',
    componentType: 'Text',
    name: 'MyHelloWorld',
    properties: {
      label: {
        value: 'Hello world!',
      },
    },
  },
  {
    id: '1234-5678-9012',
    componentType: 'Text',
    name: 'MyCodegen',
    properties: {
      label: {
        value: 'Codegen!',
      },
    },
  },
];

indexRendererManager.renderSchemaToTemplate(components);

Generate in Browser

When generating components in the browser, components will not be written to the file system.

Components

import { AmplifyRenderer } from '@aws-amplify/codegen-ui-react';

const renderConfig = {};

const component = {
  id: '1234-5678-9010',
  componentType: 'Text',
  name: 'TextPrimitive',
  properties: {
    label: {
      value: 'Hello world',
    },
  },
};

const { importsText, compText } = new AmplifyRenderer(component, renderConfig).renderComponentOnly();

Themes

import { ReactThemeStudioTemplateRenderer } from '@aws-amplify/codegen-ui-react';

const renderConfig = {};

const theme = {
  id: '1234-5678-9010',
  name: 'MyTheme',
  values: [
    {
      key: 'tokens',
      value: {
        children: [
          {
            key: 'colors',
            value: {
              children: [
                {
                  key: 'font',
                  value: {
                    children: [
                      {
                        key: 'primary',
                        value: {
                          children: [
                            {
                              key: 'value',
                              value: {
                                value: '#008080',
                              },
                            },
                          ],
                        },
                      },
                    ],
                  },
                },
              ],
            },
          },
        ],
      },
    },
  ],
};

const { componentText } = new ReactThemeStudioTemplateRenderer(theme, renderConfig).renderComponent();

index.js File

import { ReactIndexStudioTemplateRenderer } from '@aws-amplify/codegen-ui-react';

const renderConfig = {};
const components = [
  {
    id: '1234-5678-9010',
    componentType: 'Text',
    name: 'MyHelloWorld',
    properties: {
      label: {
        value: 'Hello world!',
      },
    },
  },
  {
    id: '1234-5678-9012',
    componentType: 'Text',
    name: 'MyCodegen',
    properties: {
      label: {
        value: 'CodeGen',
      },
    },
  },
];

const { componentText } = new ReactIndexStudioTemplateRenderer(components, renderConfig);

Config

Output Config

outputPathDir (Required)

The directory generated components are written to.

const outputConfig = {
  outputPathDir: './src/ui-components',
};

Render Config

script

The script kind (JSX, TSX, etc.) of generated components.

Default: TSX Allowed: TSX, JSX, JS

import { ScriptKind } from '@aws-amplify/codegen-ui-react';

const renderConfig = {
  script: ScriptKind.JSX,
};
target

The EcmaScript version (ES2016, ESNext, etc.) of generated components.

Default: ES2015 Allowed: ES3, ES5, ES6/ES2015, ES2016, ES2017, ES2018, ES2019, ES2020, ES2021, ESNext

import { ScriptTarget } from '@aws-amplify/codegen-ui-react';

const renderConfig = {
  target: ScriptTaget.ESNext,
};
module

The JavaScript module system of generated components.

Default: CommonJS Allowed: CommonJS, ESNext

import { ScriptTarget } from '@aws-amplify/codegen-ui-react';

const renderConfig = {
  module: ModuleKind.ESNext,
};
renderTypeDeclarations

Generate the type declaration files (.d.ts) for components.

Default: false Allowed: false, true

Rendering type declarations will negatively affect performance. Only generate type declarations if necessary.

Not supported in browser environments.

const renderConfig = {
  renderTypeDeclarations: true,
};

Contributing

CONTRIBUTING.md

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].