-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f200a5
commit 070b37e
Showing
3 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Component Library | ||
Flamui has a component library (Flamui.Components). | ||
|
||
## DropDown | ||
The dropdown is generic, so you can pass any type as the option, the .ToString() method will be used for the display name. | ||
|
||
```csharp | ||
var dd = ui.CreateDropDown(_selectedOption); | ||
dd.Component.Option("Mark"); | ||
dd.Component.Option("Johnny"); | ||
dd.Component.Option("Frank"); | ||
dd.Component.Option("Linus"); | ||
dd.Build(out _selectedOption); | ||
``` | ||
## Button | ||
```csharp | ||
ui.Button("Click me"); | ||
|
||
ui.Button("Button with options", primary: false, focusable: true); | ||
``` | ||
|
||
## Input | ||
The input component can't receive focus automatically, you need to pass in a boolean indicating whether it has focus or not. | ||
|
||
```csharp | ||
private string _content = ""; | ||
|
||
//an input that has allways focus | ||
ui.Input(ref _content, hasFocus: true); | ||
``` | ||
|
||
//an input with a div as a wrapper to act as the "hitbox" | ||
```csharp | ||
private string _content = ""; | ||
|
||
using(var div = ui.Div().Width(100).Height(30)) | ||
{ | ||
ui.Input(ref _content, div.HasFocus); | ||
} | ||
``` | ||
|
||
## StyledInput | ||
A styled Input component that also handles focus etc. | ||
|
||
```csharp | ||
private string _content = ""; | ||
|
||
ui.StyledInput(ref _content, placeholder: "Please type"); | ||
``` |