Skip to content

Commit

Permalink
Merge pull request #23 from rosen-group/buttondocs
Browse files Browse the repository at this point in the history
Adding docs for buttons positioning
  • Loading branch information
SDohle authored Nov 19, 2018
2 parents 90a5c81 + 4a3cac0 commit 2df56de
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,30 @@ export class AppModule {
```


### Customization of overlay buttons
Position of buttons on the onboarding overlay ('Next' and 'Turn off') can be customized:

```typescript
export class AppModule {
constructor(onboardingService: OnboardingService) {
onboardingService.configure({
buttonsConfiguration: {
position: OnboardingButtonsPosition.BottomLeft,
verticalDistanceToBorderInPx: 10,
horizontalDistanceToBorderInPx: 10
}
});
}
}
```

The above configuration would place the buttons on the bottom left side of the screen (position). Possible values for `position` are:

BottomRight (default), Bottom, BottomLeft, Left, TopLeft, Top, TopRight, Right

The distance from the left is specificied with `horizontalDistanceToBorderInPx` and the distance from the screen´s bottom
is set via `verticalDistanceToBorderInPx`.

## Translations (I18N)

See [I18N instructions](https://github.com/rosen-group/ngx-onboarding/blob/master/I18N.md)
Expand Down
3 changes: 3 additions & 0 deletions projects/ngx-onboarding/src/lib/onboarding.component.less
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
& > button {
float: right;
}
button[color=primary] {
margin-right: 8px;
}
}
.onboarding-header {
position: fixed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ export class OnboardingService {
},
buttonsConfiguration: {
position: OnboardingButtonsPosition.BottomRight,
horizontalDistanceToBorderInPx: 10,
verticalDistanceToBorderInPx: 10
horizontalDistanceToBorderInPx: 50,
verticalDistanceToBorderInPx: 40
}
};

Expand Down

0 comments on commit 2df56de

Please sign in to comment.