Allows your users to build and write custom SQL queries and then add those
queries into their dashboard as a metric, chart, or table.
Make sure QuillProvider
is a parent of the SQLEditor
component.
Examples
Props
ButtonComponent
(props: ButtonComponentProps) => JSX.Element
A primary button component.
A callback fired when the button is clicked.
The text content of the button.
Whether the button is disabled.
An icon to put in front of the label.
SecondaryButtonComponent
(props: ButtonComponentProps) => JSX.Element
A secondary button component.
A callback fired when the button is clicked.
The text content of the button.
Whether the button is disabled.
An icon to put in front of the label.
DeleteButtonComponent
(props: DeleteButtonComponentProps) => JSX.Element
A small delete button used to click out of things. Usually an “X” icon.
DeleteButtonComponentProps
A callback fired when the button is clicked.
TextInputComponent
(props: TextInputComponentProps) => JSX.Element
A input element for getting text from the user.
The id of the input element.
The width of the input element in pixels.
The width of the input element in pixels.
A label for the text input.
The placeholder for the input element.
onChange
(event: ChangeEvent<HTMLInputElement>) => void
required
An event callback that is fired when the input value changes.
SelectComponent
(props: SelectComponentProps) => JSX.Element
A select element for letting the user select from a set of options.
options
{ value: string; label: string; }[]
required
onChange
(event: ChangeEvent<HTMLInputElement>) => void
required
An event callback that is fired when the selected element changes.
The width of the select element in pixels.
TableComponent
(props: TableComponentProps) => JSX.Element
A table component.
rows
{ [key: string]: any }[]
required
The rows of the table are an array of objects.
columns
{ label: string; field: string; }[]
required
The columns of the table are an array of label, field pairs.
Whether the table is loading.
A component to show while the query results are loading.
CardComponent
(props: CardComponentProps) => JSX.Element
A card component used as a dismissable container of pivot information.
The children of the container.
A callback that is fired when the card is clicked.
A callback that is fired the card is deleted.
ModalComponent
(props: ModalComponentProps) => JSX.Element
A modal component to use to open the add to dashboard dialog.
Whether the modal is open.
setIsOpen
(isOpen: boolean) => void
required
A callback to set whether the modal is open.
The title of the modal, if any.
The width of the modal, in pixels.
The height of the modal, in pixels.
PopoverComponent
(props: PopoverComponentProps) => JSX.Element
A popover component.
Whether the modal is open.
setIsOpen
(isOpen: boolean) => void
required
A callback to set whether the modal is open.
The label for the trigger of this popover.
The title of the popover.
The children of this popover.
LabelComponent
(props: { label: string }) => JSX.Element
A label component.
The label of the label component.
A header component.
The label of the header component.
A sub-header component describes a group of inputs.
The label of the sub-header component.
TextComponent
(props: { label: string }) => JSX.Element
A simple text component.
The label of the text component.
ChartBuilderInputRowContainer
(props: { children: ReactNode }) => JSX.Element
A container for each row of inputs for the ChartBuilder form.
ChartBuilderInputRowContainerProps
The children of the container.
ChartBuilderInputColumnContainer
(props: { children: ReactNode }) => JSX.Element
A container for vertically-stacked rows of inputs for the ChartBuilder form.
ChartBuilderInputColumnContainerProps
The children of the container.
PivotRowContainer
(props: { children: ReactNode }) => JSX.Element
A container for each row of inputs for the pivot form.
The children of the container.
PivotColumnContainer
(props: { children: ReactNode }) => JSX.Element
A container for vertically-stacked rows of inputs for the pivot form.
PivotColumnContainerProps
The children of the container.
ChartBuilderFormContainer
(props: { children: ReactNode }) => JSX.Element
A container for vertically-stacked sections of the chart builder form.
ChartBuilderFormContainerProps
The children of the container.
ErrorMessageComponent
(props: { children: ReactNode }) => JSX.Element
A component that displays error messages.
ErrorMessageComponentProps
A callback that is fired when the query changes.
A callback that is fired when the data changes.
A callback that is fired when the data fields change.
A callback that is fired when the data columns change.
onAddToDashboardComplete
(report: QuillReport) => void
A callback that is fired when a new report has been added to a dashboard.
isChartBuilderHorizontalView
Whether the ReportBuilder is in admin mode (default: true
).
A callback that is fired when the data columns change.
Whether the “new query” button is enabled.
Whether to show table format options.
Whether to show date field options.
Whether to show access control options.
An existing report to edit.
The default query to use as a placeholder.
The default dashboard to add reports to.
The title of the ChartBuilder dialog.
The label of the button to add the current query to a dashboard.
addToDashboardButtonLabel
string
default:"Add to dashboard"
The label of the button to open the ChartBuilder dialog.
The name of the current organization.
Styles the top-level container of the SQLEditor.
This can be useful for TailwindCSS-style classname strings.
Custom styling properties for the ReportBuilder’s top-level container.