spark-admin-ui
v1.0.4
Published
A ui library for visualizing Spark applications
Downloads
5
Maintainers
Readme
Spark-admin ui
Spark-admin ui is a component library specifically developed to seamlessly integrate with the Spark-admin CMS, enhancing its functionality and user experience.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptions
property like this:
export default {
// other rules...
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json", "./tsconfig.node.json"],
tsconfigRootDir: __dirname,
},
};
- Replace
plugin:@typescript-eslint/recommended
toplugin:@typescript-eslint/recommended-type-checked
orplugin:@typescript-eslint/strict-type-checked
- Optionally add
plugin:@typescript-eslint/stylistic-type-checked
- Install eslint-plugin-react and add
plugin:react/recommended
&plugin:react/jsx-runtime
to theextends
list
Usage
Spark-admin default button:
import { DefaultButton } from "spark-admin-ui";
export const exampleFunc = () => {
<div>
<DefaultButton text="Example" buttonType="regular" margin="8px" />
</div>;
};
- You can also pass the onClick function in props.
- Variations of button types: regular, transparent, regular--small, regular--xs, regular--text.
Spark-admin link button:
import { LinkButton } from "spark-admin-ui";
export const exampleFunc = () => {
<div>
<LinkButton href="/" text="example" buttonType="regular" margin="8px" />
</div>;
};
- Variations of button types: regular, regular--bigger, transparent, transparent--small, regular--small, regular--xs, card--button.
Spark-admin popup image form:
import { ImageForm } from "spark-admin-ui";
export const exampleFunc = () => {
return (
<div>
<ImageForm
onClick={}
componentId=""
handleDragOver={}
handleDrop={}
handleFileChange={}
handleSubmit={}
fileName=""
/>
</div>
);
};