Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
60cf95fa
Unverified
Commit
60cf95fa
authored
Sep 21, 2020
by
Peter Holmberg
Committed by
GitHub
Sep 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs: Basic docs for FormValidationMessage (#27658)
parent
e8a6b9db
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
3 deletions
+37
-3
packages/grafana-ui/src/components/Forms/FieldValidationMessage.mdx
+27
-0
packages/grafana-ui/src/components/Forms/FieldValidationMessage.story.tsx
+7
-1
packages/grafana-ui/src/components/Forms/FieldValidationMessage.tsx
+3
-2
No files found.
packages/grafana-ui/src/components/Forms/FieldValidationMessage.mdx
0 → 100644
View file @
60cf95fa
import { Meta, Props } from '@storybook/addon-docs/blocks';
import { FieldValidationMessage } from './FieldValidationMessage';
<Meta title="MDX|FieldValidationMessage" component={FieldValidationMessage} />
# FieldValidationMessage
Component for displaying a validation error message under an element.
### Example usage
An example usage of this is in out `FormField` component.
```tsx
export const CustomFormField = () => {
return (
<div>
Label
<div>
<input />
{error &&
(<FormValidationMessage>Invalid input</FormValidationMessage>)}
</div>
</div>
)
}
```
<Props of={FieldValidationMessage} />
packages/grafana-ui/src/components/Forms/FieldValidationMessage.story.tsx
View file @
60cf95fa
import
React
from
'react'
;
import
{
FieldValidationMessage
}
from
'./FieldValidationMessage'
;
import
{
text
}
from
'@storybook/addon-knobs'
;
import
{
FieldValidationMessage
}
from
'./FieldValidationMessage'
;
import
mdx
from
'./FieldValidationMessage.mdx'
;
const
getKnobs
=
()
=>
{
return
{
...
...
@@ -11,6 +12,11 @@ const getKnobs = () => {
export
default
{
title
:
'Forms/FieldValidationMessage'
,
component
:
FieldValidationMessage
,
parameters
:
{
docs
:
{
page
:
mdx
,
},
},
};
export
const
simple
=
()
=>
{
...
...
packages/grafana-ui/src/components/Forms/FieldValidationMessage.tsx
View file @
60cf95fa
import
React
from
'react'
;
import
{
useTheme
,
stylesFactory
}
from
'../../themes'
;
import
{
GrafanaTheme
}
from
'@grafana/data'
;
import
{
css
,
cx
}
from
'emotion'
;
import
{
GrafanaTheme
}
from
'@grafana/data'
;
import
{
Icon
}
from
'../Icon/Icon'
;
import
{
useTheme
,
stylesFactory
}
from
'../../themes'
;
export
interface
FieldValidationMessageProps
{
children
:
string
;
/** Override component style */
className
?:
string
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment